
MySQL/PHP with redundant slave servers
I have a bunch of web servers that depend on mysql DB to
provide data to dynamically generated web pages.
For MySQL, I have one master and two slaves.
The link to the DB is via php. I want the slave servers to act also
redundant servers for providing data to my php code.
I tried the following
$db = mysql_connect(server1,user,pass) or mysql_connect(server2,user,pass)
but, if fails to go with to server2 if server1 is down, Is there any thing
that I am doing wrong ?
Anand