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");
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…