Home > Backend Development > PHP Tutorial > php中找不到资源是怎么回事

php中找不到资源是怎么回事

WBOY
Release: 2016-06-02 11:29:41
Original
1292 people have browsed it

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这样的错误不知道怎么回事,检查了好几遍,求大神指导啊

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template