In my database model, I have a function that accepts an SQL statement as a parameter and returns the results in what I believe is an array of objects.
But if no records are found, it is returning "0" instead of an array of objects.
I know this can't be right because I get syntax errors when I try to test the returning results when no records are found.
What would be the proper way to handle this so that the controller can check to see if any results are returned before calling the view?
Code is attached.
$results = $this->masters->query($sql);
$results = $results->result_array();