Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Problem ze zrobieniem rankingu
lampard029
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 28.02.2011

Ostrzeżenie: (0%)
-----


Wywala mi taki błąd:
  1. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/26/d342392629/htdocs/wsb6023455601/ranking.php on line 31
  2.  
  3. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homepages/26/d342392629/htdocs/wsb6023455601/ranking.php on line 44


31linijka:
  1. while ( $g = mysql_fetch_array ($gracze) )




44:
  1. while ($g = mysql_fetch_array($gracze)){
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
lampard029
post
Post #2





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 28.02.2011

Ostrzeżenie: (0%)
-----


  1. <?php
  2. //włączamy bufor
  3.  
  4. //pobieramy zawartość pliku ustawień
  5. require_once('var/ustawienia.php');
  6.  
  7. //startujemy lub przedłużamy sesję
  8.  
  9. //dołączamy plik, który sprawdzi czy napewno mamy dostęp do tej strony
  10. require_once('test_zalogowanego.php');
  11.  
  12.  
  13. //pobieramy nagłówek strony
  14. require_once('gora_strony.php');
  15.  
  16. //pobieramy zawartość menu
  17. require_once('menu.php');
  18. ?>
  19. <h2>Ranking</h2><hr/>
  20. <table id='rank'>
  21. <tr style='background:#8F8F8F;'>
  22. <th>Miejsce</th>
  23. <th>Gracz</th>
  24. </tr>
  25.  
  26.  
  27. <?php
  28. $gracze = mysql_query("select * from soccer_gracze where ranking > 0 order by ranking asc");
  29. while ( $g = mysql_fetch_array ($gracze) )
  30.  
  31. {
  32. $i++;
  33. if($i % 2 == 0) $styl = " style='background:#B2B2B2'"; else $styl="";
  34. echo "
  35. <tr align='center' ".$styl.">
  36. <td>".$i."</td>
  37. <td>".$g['login']."</td>
  38. </tr>";
  39. }
  40.  
  41. $gracze = mysql_query("select * from soccer_gracze where ranking = 0");
  42. while ($g = mysql_fetch_array($gracze)){
  43. $i++;
  44. if($i % 2 == 0) $styl = " style='background:#B2B2B2'"; else $styl="";
  45. echo "
  46. <tr align='center' ".$styl.">
  47. <td>".$i."</td>
  48. <td>".$g['login']."</td>
  49. </tr>";
  50. }
  51. echo "</table>";
  52.  
  53.  
  54.  
  55.  
  56.  
  57. //pobieramy stopkę
  58. require_once('dol_strony.php');
  59.  
  60. //wyłączamy bufor
  61. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Closed 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.12.2025 - 21:33