Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> mysql_num_rows - problem
Beosky
post
Post #1





Grupa: Zarejestrowani
Postów: 62
Pomógł: 0
Dołączył: 13.02.2012
Skąd: Wrocław

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


Cytat
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\Program Files\WebServ\httpd\register.php on line 13


A, tutaj kod
  1. <?php
  2. require ('config/polacz.php');
  3.  
  4. $login = strip_tags(mysql_escape_string($_POST['login']));
  5. $haslo = md5($_POST['haslo']);
  6. $haslo2 = md5($_POST['haslo2']);
  7. $email = strip_tags(mysql_escape_string($_POST['email']));
  8.  
  9. $spr="SELECT id FROM users WHERE login='$login' OR email='$email'";
  10. mysql_query($sql) or die(''.mysql_error());
  11. $wspr = mysql_query($spr);
  12.  
  13. if(mysql_num_rows($wspr)==0) {
  14. }
  15. else {
  16. echo "Podany login lub email jest już używany przez innego użytkownika!";
  17. }
  18. ?>


Komunikat z mysql_error:
Cytat
Zapytanie było puste


Z tego co wyczytałem w google:
mysql_num_rows potrzebuje wskaźnika na wynik z mysql_query

Mam ustawione.. :/
Go to the top of the page
+Quote Post
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




http://forum.php.pl/index.php?showtopic=193733&hl=
Go to the top of the page
+Quote Post

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.08.2025 - 15:57