Forum Moderators: coopster
Is there anything in PHP that can attempt a reconnect maybe 3 attempts in the next 15 seconds? It's not ideal as it's on a page where it would keep my users waiting for 15 seconds but better that it attempts the insert than me have to put it into the database at a later stage through an integrity check.
If the insert/update is not time sensitive (it's not something where the user needs to see the changed data immediately) then you might consider giving the job of inserting the data to a secondary script/process.
If you end up deciding to keep the user waiting, make sure to look at this function: [php.net...]
//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);