当我的 login.php 文件加载时出现此错误。'警告:mysql_num_rows():提供的参数不是有效的 MySQL 结果资源'这是我所拥有的..
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
if($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{
$dbusername = $row['username'];
$dbpassword = $row['password'];
}
if ($username==$dbusername&&$password==$dbpassword)
{
echo "Youre in!";
}
else
echo "Incorrect Password!";
}
else
die("That user doesnt exist!");
}
else
die("Please enter a username and a password!");
?>