php和mariadb不能正常工作

时间:2018-05-13 09:47:07

标签: php mysql mariadb

每当我得到正确的'hwid'时,我只是想向页面显示一些内容,但无论hwid是否在数据库中,它仍然显示为0.任何帮助?

[...] 
else if($action == "dl")
{
    $query = $con->query("SELECT * FROM `users` WHERE hwid = '$hwid'");
    $cnt = $query->num_rows;

    if($cnt == 1)
    {
        $logged = 1;
    }
    else if ($cnt == 0)
    {
        $logged = 0;
    }       
    else
    {
        $logged = 0;
    }
    if ($logged == 1)
    {
        echo 'yep';
    } else {
        echo '0';
    }
}

0 个答案:

没有答案