代码看起来很简单
$q = "SELECT COUNT(*) as 'total' FROM table";
// does not work
$total = $conn->query($q)->fetch_assoc()['total'];
// works
$res1 = $conn->query($qcount_no_admin);
$row1 = $res1->fetch_assoc();
$total = $row1['total'];
我收到500错误(暂时我无法显示错误,必须与主持人交谈)。
这种方法链接在php mysqli中是否可行?