Pretty new at php and working on my class project.
I get this error code on my action page for my log in page plus, it does not redirect when the result is wrong. I still get into the members' area.
Code below. Thanks
"mysql_num_rows(): supplied argument is not a valid MySQL result resource"
<?php
$conn=mysql_connect("localhost","root","");
if ($conn) {
print "Connection ok. <br>";
}
$select=mysql_select_db("litto",$conn);
print "Database selected.<br>";
$sql="SELECT * FROM users WHERE username='$_POST[username] AND password='$_POST[password]'";
$results=mysql_query($sql);
if (mysql_num_rows(results)> 0) {
print "Welcome to the system";
}
else{
print "check username and password";
}
admin.php;
mysql_close($conn);
?>