i have a php script, that i am trying to randomly choose which mysql server to connect to.
$hosts = array ('10.0.0.6', '10.0.0.5', '10.0.0.4');
$rand_keys = array_rand($hosts);
$sqlh = mysql_connect($hosts[$rand_keys[0]], 'USERNAME', 'PASSWORD');
it does not seem to be connecting.. not sure what is wrong: in the page, i see this:
Warning: mysql_connect(): Can't connect to MySQL server on '1' (22) in /home/test.php on line 35
Warning: mysql_connect(): Can't connect to MySQL server on '7' (22) in /home/test.php on line 35
Any help would be very helpful.
Thanks