Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL] Zapytanie z pętlą
Lethys
post
Post #1





Grupa: Zarejestrowani
Postów: 642
Pomógł: 2
Dołączył: 9.03.2006

Ostrzeżenie: (30%)
XX---


Mam proste zapytanie z pętlą

  1. <?php
  2.  
  3. $tsel = mysql_query("select * from players where prison='0'");
  4. while ($top = mysql_fetch_array($tsel)) {
  5. $nagroda = $top[zabicia]*120;
  6. print "<tr><td><center>$top[user]</center></td><td><center>$top[zabicia]</center></td><td><center>$nagroda</center></td>";
  7. }
  8. print "</table><br>";
  9. ?>


i wywala mi błąd

Cytat
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\WebServ\httpd\westernlife\wiezienie.php on line 57


Co jest zle ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




  1. <?php
  2. $tsel = mysql_query("select * from players where prison='0'") or die(mysql_error());
  3. ?>

I juz wiesz co masz źle?
Go to the top of the page
+Quote Post
Lethys
post
Post #3





Grupa: Zarejestrowani
Postów: 642
Pomógł: 2
Dołączył: 9.03.2006

Ostrzeżenie: (30%)
XX---


Wiem dziekuje (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 18:48