I am currently running PHP 5.5.10 and I am not sure why I am receiving the following error:
Fatal error: Call to undefined method mysqli_result::fetch_all()
This is my code:
<?php
require_once('db_connect.php');
if ($result = $db->query("SELECT * FROM user_settings")) {
if ($count = $result->num_rows) {
echo '<p>', $count, '</p>';
$rows = $result->fetch_all(MYSQLI_ASSOC);
echo '<pre>', print_r($rows), '</pre>';
}
} else {
die('There was an error with the MySQL Query: ' . '<br />' . '<b>'.$db->error.'</b>');
}
?>
db_connect.php
<?php
error_reporting(1);
require_once('db_config.php');
$db = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
if ($db->connect_errno) {
die('Sorry, we are currently experiencing some problems.');
}
?>
Why am I experiencing this error? Is it to do with mysqlnd? If so how can I fix the issue?