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";
我试图通过多种方式解决这个问题,但我不知道问题出在哪里 - 如视频中所示。
一切似乎都很好,但我不知道为什么它不起作用。以下是错误消息的屏幕截图:
答案 0 :(得分:0)
查询失败,因为=
中缺少and password '$user_password'
。结果是,$result
不是对象。这让mysqli_num_rows
失败