Forum Moderators: coopster
//connection to remote database to check and enter the details
$squid_conn = mysql_connect("myserver",
"user",
"pw");
while (!$squid_conn) {
sleep(10);
$squid_conn = mysql_connect("myserver",
"user",
"pw");
}
mysql_select_db("mydb", $squid_conn);
$timeout = 10;
$i = 0;
while((($link = mysql_connect()) === false) ¦¦ $i >= $timeout++)
;
BTW, if you are experiencing continuous trouble connecting to your database server then you should seriously consider finding an alternate configuration.
$timeout = 10;
$i = 1;
while((($link = mysql_connect()) === false) ¦¦ $i >= $timeout++)
{
sleep(10);
}
How could I add a die stament in there for the 10th retry?
It's usually on one retry in case it has lost some packets over the internet connection.