CodeIgniter Forums
PHP Fatal error: system/database/drivers/mysqli/mysqli_driver.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: PHP Fatal error: system/database/drivers/mysqli/mysqli_driver.php (/showthread.php?tid=64930)



PHP Fatal error: system/database/drivers/mysqli/mysqli_driver.php - Mladen - 04-12-2016

In Codeigniter version 3.x in error_log I get this error
Code:
PHP Fatal error:  Call to a member function query() on boolean in /home/account/public_html/domain/system/database/drivers/mysqli/mysqli_driver.php on line 264

I didn't notice any issues in work of application but this fatal error make me nervous,  more than 5 people work on testing this application and nobody get any error...


RE: PHP Fatal error: system/database/drivers/mysqli/mysqli_driver.php - Narf - 04-12-2016

When trying to debug something, and especially when you're not using the latest version (which you should, but aren't), it is bad to generalize version numbers ... If you had provided the exact version number, I wouldn't have to go through half of the 3.0.x releases in order to find the matching line: https://github.com/bcit-ci/CodeIgniter/blob/3.0.3/system/database/drivers/mysqli/mysqli_driver.php#L264

And the non-object on that line is $this->conn_id, which, if it is not indeed an object, means that you're trying to run a query before connecting to the database (or the connection failed, but you didn't check for that).


RE: PHP Fatal error: system/database/drivers/mysqli/mysqli_driver.php - Mladen - 04-12-2016

(04-12-2016, 11:05 AM)Narf Wrote: When trying to debug something, and especially when you're not using the latest version (which you should, but aren't), it is bad to generalize version numbers ... If you had provided the exact version number, I wouldn't have to go through half of the 3.0.x releases in order to find the matching line: https://github.com/bcit-ci/CodeIgniter/blob/3.0.3/system/database/drivers/mysqli/mysqli_driver.php#L264

And the non-object on that line is $this->conn_id, which, if it is not indeed an object, means that you're trying to run a query before connecting to the database (or the connection failed, but you didn't check for that).

I use the latest version of CI 3.0.6.

Perhaps the problem is server, if the connection is interrupted briefly and in that moment i get this error.
I need to check with my hosting provider.

Thanks for the info Smile