How to handle DB connection errors |
Hello all,
I have developed a superadmin system that manages an admin interface for a lot of users, each with his own database. It is working well, but there's one situation that I'm not able to handle yet. When logging in, the superadmin supplies the ID of the database he will access. There are three alternatives as for the outcome:
PHP Code: $config['hostname'] = $row->server; // from the superadmin DB However, in situation #2 the "conn_id" error is not reached. CodeIgniter steps in with the "Unable to connect to your database server using the provided settings." error and that's it. Is there a way to handle this kind of connection error, so I can redirect to the previous page and inform the user? I don't want the CI error page to show. Thank you very much for your help. |
Messages In This Thread |
How to handle DB connection errors - by guilhermemuller - 05-15-2017, 11:42 AM
RE: How to handle DB connection errors - by InsiteFX - 05-15-2017, 01:03 PM
RE: How to handle DB connection errors - by guilhermemuller - 05-16-2017, 06:04 PM
RE: How to handle DB connection errors - by guilhermemuller - 05-18-2017, 07:28 AM
RE: How to handle DB connection errors - by InsiteFX - 05-18-2017, 08:34 AM
RE: How to handle DB connection errors - by reactionstudio - 05-22-2017, 04:33 AM
|