I make method to fecth data table from database, I'm using MySQL
and PHP ver. 5.6
, and this is my code :
public function fetch($table, $notation = null, $where = null) {
if ($notation != null) {
$sql = "SELECT $notation FROM $table";
} else {
$sql = "SELECT * FROM $table";
}
if ($where != null) {
$sql .= " WHERE $where";
}
$query = $this->connection->query($sql) or die ($this->connection->error);
return $query->fetch_all(MYSQLI_BOTH);
}
when i try to access this method offline, it's work perfectly, but when i try to access it on webhost i've got error message : Call to undefined method mysqli_result::fetch_all()
whereas i'm using the same PHP
version.
could someone help me to solve this problem ? i would be grateful for it.