Re: losing mysql connection during cron job
| From: | Shiplu | Date: | Wed, 18 Jun 2008 23:49:00 +0000 |
| Subject: | Re: losing mysql connection during cron job | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275550@lists.php.net to get a copy of this message | ||
>
> The script cycle is, symbolically:
>
> foreach (recipients as batch)
> {
> mail() using batch of recipients;
> mysql_query() update table;
> sleep(60);
> }
> final mysql_query() update table as complete;
>
>
why don't you edit your code?
foreach (recipients as batch)
{
mail() using batch of recipients;
mysql_query() update table;
if(mysql_errno()==ERROR_CODE_YOU_GET){
mysql_connect();
mysql_select_db();
}
sleep(60);
}