【发布时间】:2016-03-13 11:15:29
【问题描述】:
我想将数据从 SQL 表中提取到我的 PHP 脚本中的数组中。我需要那个,因为在那之后我想比较两个表。
$sql = "select date, sum(clicks) from Table group by date";
$query = $Db->query($sql);
$result = array(); // Script does not work even if I remove this line
$result = $query->fetchAll();
print_r($result);
我收到了错误:
PHP 致命错误:调用未定义方法 mysqli_result::fetchAll()
【问题讨论】:
-
$result = $query->fetch_all();PHP Docs