mysqli fetch_all() not a valid function?
The typical way to construct an associative array is in a while
loop:
$results_array = array();
$result = $mysqli->query($query);
while ($row = $result->fetch_assoc()) {
$results_array[] = $row;
}
This function is available since PHP 5.3.0. Possibly your version is older. Use fetch_assoc()
instead.
while ($row = $result->fetch_assoc()) {
// do what you need.
}
mysqli::fetch_all()
needs mysqlnd
driver to be installed before you can use it.