开发者

mysql num rows is failing

开发者 https://www.devze.com 2022-12-15 10:35 出处:网络
$result=mysql_query(\"SELECT * FROM users WHERE pa开发者_高级运维ss=\'\".sha1($_POST[\'mainloginpass\']).\"\'\");
$result=mysql_query("SELECT * FROM users WHERE pa开发者_高级运维ss='".sha1($_POST['mainloginpass'])."'");

if(mysql_num_rows($result)==1){

it says that "mysql_num_rows() expects parameter 1 to be resource, boolean given"


mysql_query normally returns a resource, but according to the docs:
mysql_query() will return FALSE on error and also fail and return FALSE if the user does not have permission to access the table(s) referenced by the query.

You may want to try something like this:

if (!$result) {
    die('Invalid query: ' . mysql_error());
}

To see what the problem is.

0

精彩评论

暂无评论...
验证码 换一张
取 消