I am currently using mysqli
to crate a connection to my database. My host server doesnt support PDO connections so that is why I am using mysqli. When making the connection I am getting this error:
Fatal error: Call to undefined method mysqli_result::fetchAll()
Is fetchAll()
not part of mysqli?
PHP Connect to DB
$mysqli = new mysqli('localhost', 'user', 'password', 'database');
if (mysqli_connect_error()) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
else {
echo ('Success... ');
}
$sql = "SELECT *
FROM `categories`
WHERE `master` = 0";
$statement = $mysqli->query($sql);
$list = $statement->fetchAll();