[eluser]blzabub[/eluser]
I've developed a website which accesses 2 separate MySQL databases, one locally on the same server as the web host and another on a remote host. I autoload the database library with both databases configured. This usually works fine, but occasionally, the external database is not available and it causes any site controller that uses that external database to fail and so I get many blank pages. What is the best way to prevent this from happening given the assumption that I cannot control the uptime of the external MySQL server? Is there a way I can change the code that loads the model which uses the external database so that if it fails to connect, it will degrade more elegantly than a blank page. Current code looks like this-
Code:
$this->load->model('calendars_model','',TRUE));
Is this failing at the autoload of the database library level, at the loading of the model level or at the active record query level or at the controller level? I'm afraid my understanding of CI is not deep enough to know.
Thanks for any help,
~Ben