我是mysqli的新手,开始学习基础知识。就此而言,我尝试了fetch_array示例(http://php.net/manual/en/mysqli-result.fetch-array.php)。以下是我的代码。
$sqlGetChartData = "SELECT date, ratepersqft, location
FROM ratepersqft
WHERE project_id = 1";
$runGetChartData = $mysqli->query($sqlGetChartData);
while($rowGetChartData = $runGetChartData->fetch_array(MYSQLI_BOTH))
$arrGetChartData[] = $rowGetChartData;
print "<pre>";
print_r($arrGetChartData);
exit();
我在while条件语句附近的代码行中遇到了这个错误:Call to a member function fetch_array() on a non-object。我尝试过在谷歌上搜索,但没有找到解决我的问题的结果。希望我的问题清晰明了。谢谢。