I am seeing in my logs the following error on some of my custom queries:
Call to a member function result() on a non-object
class Test_Model extends CI_Model
public function __construct()
public function get_all($id)
$query = $this->db->query("SELECT * FROM tbl WHERE id=?", array($id));
return $query->result(); // Error is on this line
It seems to throw the error when the result set is empty.... Is this normal behavior?
Using the latest develop btw...
An empty result or a failed query? It's not expected behavior if it's the first, but I also don't see how that would happen if the query was successful.
Mmm I will take a look... could be a failed query somewhere... weird..