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.
So why does this happen?
$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);
you probably want $mypassword isntead of $password and instead of $email (which is not even set) you have it as $myusername