Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/folder/public_html/folder/folder/login.php on line 18 [duplicate]

跟風遠走 提交于 2019-11-28 14:51:38

This error is because the previous call to mysql_query is not producing a result set, but a false stating that the query had failed.

mysql_query() or die(mysql_error());

to see the problem. try the above code. From the code you have posted $tbl_name is not a visible variable name.

Warning: mysql_ finctions are deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used.

You are not checking if the mysql_query was successful or not. If the query was unsuccessful mysql_query returns false. Refer to mysql_query Manual

Try

$result=mysql_query($sql);
if ($result==false)
{
    die(mysql_error());
}
$count=mysql_num_rows($result);

I have gone through once...!

Tried all possible ways.... didn't workout..!

Finally found that there is nothing wrong in the code!! It's the problem when you "Import" a database where you have exported earlier!

(This will sound wired!!) but this was the case....!

Check your Exported DB Script, Whether it contains Create database code section.... with some other name or with a prefix!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!