mysqli登录检查失败

时间:2016-04-05 15:23:43

标签: php mysql-error-1064

if(mysqli_num_rows($result) > 0 )
$user_name = "123";
$user_password = "123";
$mysql_qry = "SELECT * FROM employee_data WHERE username like '$user_name' and password '$user_password' ";
$result = mysqli_query($conn,$mysql_qry);
if(mysqli_num_rows($result) > 0 )
    echo "login success";
else
    echo "login not success";

我试图通过多种方式解决这个问题,但我不知道问题出在哪里 - 如视频中所示。

一切似乎都很好,但我不知道为什么它不起作用。以下是错误消息的屏幕截图:

help me where is the problem

1 个答案:

答案 0 :(得分:0)

查询失败,因为=中缺少and password '$user_password'。结果是,$result不是对象。这让mysqli_num_rows失败