My script was working fine on my localhost and when I uploaded it to my online host, I get a Call to undefined method mysqli::mysqli_fetch_all()
error. I read up online and found out it has to do with a missing MySQLnd driver.
My host uses c panel and I cannot install any extensions. My local php version is 5.5.12 and the one on my hosting server is 5.6.26 and the MySQL version is 5.5.52-cll.
After reading up, I changed the fetch_all()
to fetch_assoc()
, the error went away but the DB only returns one result even though I am using it in a loop. What am I doing wrong?
if (!$errors) {
if ($result = $mysqli->query($addresult)) {
while ($row = $result->fetch_all()) {
$returnResult = $row;
}
}
}