得到mysqli_fetch_assoc错误

时间:2015-01-05 13:07:32

标签: php mysqli

在我的主页中运行此代码时出错 我试图在我的网站上获得注册账号的数量

代码:

function user_count(){
    $query = mysqli_query($GLOBALS["con"], 'SELECT COUNT user_id FROM users WHERE active = 1');
    $row = mysqli_fetch_assoc($query);
    return $row;
}

$GLOBALS["con"] is defined in another place as 
$GLOBALS["con"] = mysqli_connect("localhost","root","","Login"); 

我在页面上收到此错误:

警告:mysqli_fetch_assoc()要求参数1为mysqli_result,第4行/Applications/XAMPP/xamppfiles/htdocs/core/functions/users.php中给出布尔值

有关于此的任何想法吗?我想解决这个问题...

0 个答案:

没有答案