• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DB reconnect failed

#3
In the mysqli driver, reconnect() uses mysqli::ping(), which will attempt to reconnect to the server if the mysqli.reconnect option is enabled on the server. In any case, after calling $this->db->reconnect(), you should check whether $this->db->conn_id is false before attempting to use the connection. If it is false, you could attempt to close/initialize as you did, but you should check the return value of initialize() before attempting to use the connection (as it will return false if it fails to connect/initialize).
Reply


Messages In This Thread
DB reconnect failed - by imwwp - 12-25-2015, 11:24 PM
RE: DB reconnect failed - by imwwp - 12-26-2015, 01:18 AM
RE: DB reconnect failed - by mwhitney - 12-29-2015, 11:33 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.