In php is there a quick way to say if db1 is unavailable connect to db2 instead?
Here is what I’m doing now:
$username="XXXXXXXXX";
$password="XXXXXXXXX";
$database="XXXXXXXXX";
$hostname="XXXXXXXXX";
mysql_connect($hostname,$username,$password);
@mysql_select_db($database) or die("unable to select database");
mysql_select_db will return a boolean indicating if it succeeded.
http://id2.php.net/manual/en/function.mysql-select-db.php