PHP Fatal error: Call to a member function num_rows() on boolean - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: PHP Fatal error: Call to a member function num_rows() on boolean (/showthread.php?tid=67747) |
PHP Fatal error: Call to a member function num_rows() on boolean - mackavelli - 04-04-2017 PHP Code: public function count_all_results($table = '', $reset = TRUE) // I have searched for a solution but nothing so far RE: PHP Fatal error: Call to a member function num_rows() on boolean - koficypher - 04-04-2017 Reduce the number of equal to sign to two instead of 3. change if ($result->num_rows() === 0) to: if ($result->num_rows() == 0) Boolen 0 is false and 1 is true. RE: PHP Fatal error: Call to a member function num_rows() on boolean - Narf - 04-04-2017 (04-04-2017, 08:52 AM)koficypher Wrote: Reduce the number of equal to sign to two instead of 3. This won't change anything. It's not the num_rows() return value that's the problem. It's that $result is not an object at all, meaning that the query errored. |