Welcome Guest, Not a member yet? Register   Sign In
Connect to alternate DB when default DB is down?
#1

[eluser]bradym[/eluser]
On our sites that are not using CodeIgniter we have code like the following:

Code:
$db = mysql_connect('localhost', 'username', 'password');

if(!$db){
     $db = mysql_connect('remote_server', 'username', 'password') ;    
}

to connect to a backup server if the local mysql server is down for some reason.

Has anyone done this kind of thing with CodeIgniter? If so, would you mind sharing code or ideas?

Thanks!

Brady


Messages In This Thread
Connect to alternate DB when default DB is down? - by El Forum - 07-29-2008, 06:51 PM
Connect to alternate DB when default DB is down? - by El Forum - 07-29-2008, 07:17 PM
Connect to alternate DB when default DB is down? - by El Forum - 07-29-2008, 07:23 PM
Connect to alternate DB when default DB is down? - by El Forum - 07-29-2008, 08:03 PM
Connect to alternate DB when default DB is down? - by El Forum - 07-30-2008, 05:22 PM
Connect to alternate DB when default DB is down? - by El Forum - 07-30-2008, 06:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB