Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]mysql_fetch_assoc & mysql_num_rows, [MySQL][PHP]mysql_fetch_assoc & mysql_num_rows
Konop857
post 8.11.2011, 20:25:01
Post #1





Grupa: Zarejestrowani
Postów: 81
Pomógł: 2
Dołączył: 4.05.2011

Ostrzeżenie: (10%)
X----


Witam, na domowym XAMPP-ie wszystko śmigało, lecz na hostingu już buguje:
Cytat
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/cyclopso/public_html/index.php on line 48

Cytat
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cyclopso/public_html/overview.php on line 18

Przy każdym mysql_fetch_assoc & mysql_num_rows wyskakują takie błędy, oto jak używam tych dwóch funkcji:
  1. $ile = mysql_query("SELECT * FROM `news`");
  2. $ile = mysql_num_rows($ile);
  3. if ($ile > 5)
  4. {
  5. echo "<center><m1>Archiwum</m1></center>";
  6. }

  1. $query = "SELECT * FROM `news` ORDER BY `id` DESC LIMIT 5";
  2. $result = mysql_query($query);
  3. while ($row = mysql_fetch_assoc($result))
  4. {
  5. echo "<b>$row[data] | ".$SQL->translate($row[tytul])."</br>
  6. <center><img src='layouts/$layout/images/others/blok.bmp' /></center></br>
  7. <center>".$SQL->translate($row[tresc])."</center></br></br>
  8. <p align='right'>".$SQL->translate($row[od])."</p></b>
  9. <center><img src='layouts/$layout/images/others/blok.bmp' /></center>";
  10. }

Może i mój problem jest banalny ale ja nie mogę go rozwiązać, proszę o pomoc.

Pozdrawiam
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 10:28