0

I just started PHP linked to MySQL and I got a really annoying problem. The complete warning on my server says:

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in DIRECTION REMOVED BY ME on line 20 Wrong Username or Password

I am pretty sure the Password or Username is not wrong, it's just the If/else which will give this as a result. So here is the php file which will be called when pressing the login button.

CODE HERE: http://pastie.org/private/tqubwhlha0wcyiotkgzeyg

So why does this happen?

4

1 回答 1

0
$myusername=mysql_real_escape_string($_POST['email']);
$mypassword=mysql_real_escape_string($_POST['password']);

$sql="SELECT * FROM $users WHERE email='$email' and password='$password'";
$result=mysql_query($sql);

你可能想要$mypassword而不是$password而不是 $email (甚至没有设置)你有它作为$myusername

您正在使用的功能已弃用,请看一下另外,(注意)您真的不应该在会话中存储密码(如果是纯文本,则更不用说!!),看看

于 2013-06-05T17:44:14.357 回答