Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL][PHP]Lista userów
VirG
post
Post #1





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 12.10.2010

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


Witam.

Robiłem listę userów i wyskakuje takie coś:
Kod
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/sites/yoyo.pl/l/e/xxx/skrypty/users.php on line 10
ID    Nick    GG



Kod:
  1. <?php
  2.  
  3. $wynik=mysql_query("SELECT `user_login`, `user_id` FROM `users` order by `user_login`");
  4.  
  5. function ShowUsers()
  6. {
  7. echo "<table>";
  8. echo "<tr>";
  9. echo "<td>ID</td><td>Nick</td><td>GG</td>";
  10. while($rekord=mysql_fetch_array($wynik))
  11. {
  12. echo "<td>".$rekord["user_id"]."</td>";
  13. echo "<td>".$rekord["user_login"]."</td>";
  14. echo "<td>xXx</td>";
  15. }
  16. echo "</tr>";
  17. echo "</table>";
  18. }
  19. ?>


Ten post edytował VirG 20.10.2010, 15:36:55
Go to the top of the page
+Quote Post
hind
post
Post #2





Grupa: Zarejestrowani
Postów: 142
Pomógł: 24
Dołączył: 30.03.2009
Skąd: Rokitno Szlacheckie

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


przekaż do funkcji argument zapytania
bo tak to Ci się wywala na tym że $wynik nie jest dostępny w funkcji

Ten post edytował hind 20.10.2010, 15:51:18
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: 23.08.2025 - 19:56