Heim > Artikel > Backend-Entwicklung > php中找不到资源是怎么回事
php
mysql_connect("localhost","root","lvhui");
mysql_query("set names gbk");
$sql= "select * from user where username=$username and password=$password";
$result=mysql_db_query("student",$sql);
if ($data=mysql_fetch_object($result))
{ echo "alert('登陆成功')";
echo "学生管理页面";
}
else
{ echo "alert('登陆失败,请检查用户名或密码')
";
echo "重新登陆";
}
?>
总是出现mysql_fetch_object(): supplied argument is not a valid MySQL result resource in这样的错误不知道怎么回事,检查了好几遍,求大神指导啊