Please, how do I resolve the following error?
Fatal error: Call to a member function fetch_assoc() on a non-object in......
database.php
protected function get_results_from_query() {
$this->open_connection();
$result = $this->conn->query($this->query);
while ($this->rows[] = $result->fetch_assoc());
$result->close();
$this->close_connection();
array_pop($this->rows);
}
usuario.php
public function getUsers(){
//$this->query variable define in class abstract database
$this->query = " SELECT * FROM Usuario LIMIT 0, 30";
$this->get_results_from_query();
}
Everything is working perfect, but calling function getUsers
results in "fatal error".