我收到fetch_assoc() on a non-object
错误,我确实回应了查询,并在PHPMyAdmin中运行它。它会返回1个结果。但是当我尝试使用fetch_assoc()时,我仍然会收到错误。
$autoquery = "SELECT
Year,Vozila, Marke_vozila, Model_vozila, bodywork, doors, fuel, gear_box, Tip_vozila, izvedba_vozila, hide
FROM vozila_tbl
WHERE
Year = 2008 AND Marke_vozila = 'Iveco' AND Model_vozila = 'Daily' AND Tip_vozila = '29 L 10V 300 H2 | 5-vrata MPV 70 kw (06/06 - 10/11' AND Vozila='Auto'
GROUP BY izvedba_vozila
ORDER BY izvedba_vozila DESC";
$autoresult = $mysqli->query($autoquery);
$array[0][] = "Birajte ".$option;
//Database values
while($row = $autoresult->fetch_assoc()){ //This is the line it says fetch_assoc() is a non-object
$array[1][] = $row[$value];
}
$array[1] = print_r($mysqli->error);
return $array;