PHP警告:mysqli_num_rows()需要参数1

时间:2016-09-08 17:58:34

标签: php mysql database android-studio server

我正在为我们的Android登录系统学习php和mysql。我按照完全相同的PHP代码来测试数据库。请帮我弄清楚我的代码有什么问题。我仔细检查了一切,他的代码似乎正在运作。

<?php
    require "connect.php";
    $user_name = "claude28";
    $user_password = "simplepassword";
    $mysql_qry = "select * from user_data where username like '$user_name' and password like '$user_password';";

    $result =  mysqli_query($conn,$mysql_qry);

    if(mysqli_num_rows($result)>0) {
        echo "Log in Success";
    }
    else{
        echo "Log in Unsuccessful";
    }


?>

0 个答案:

没有答案