note 23476 added to function.mysql-num-rows

From: Date: Fri, 19 Jul 2002 07:44:07 +0000
Subject: note 23476 added to function.mysql-num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-33291@lists.php.net to get a copy of this message
I'm making a login script, and I have this: $checkReg = mysql_query("SELECT * FROM userdb WHERE username='$login_user' AND password=PASSWORD('$login_pass')"); $num = mysql_num_rows($checkReg); if($num == 0) { echo "Sorry, you have some wrong information."; } else { login normally } I'm using $checkReg and $num to make sure the username and password match, but the script always echo's out "Sorry, you have some wrong information." Why? Everything should work perfectly. Thanks. :) -- http://www.php.net/manual/en/function.mysql-num-rows.php http://master.php.net/manage/user-notes.php?action=edit+23476 http://master.php.net/manage/user-notes.php?action=delete+23476 http://master.php.net/manage/user-notes.php?action=reject+23476

« previous php.notes (#33291) next »