Re: [PHP] losing mysql connection during cron job

2008-06-19 Thread Paul Novitski
At 6/18/2008 02:47 PM, Paul Novitski wrote: I've got a simple script running as a cron job that's getting intermittent "Lost connection to MySQL server during query" errors. At 6/18/2008 10:43 PM, Chris wrote: You need to do a mysql_close(); mysql_connect(...) before mysql_query works again

Re: [PHP] losing mysql connection during cron job

2008-06-18 Thread Chris
> Thanks for the suggestion. I am currently successfully working around > this error by another method, although your suggestion is probably better. > > The reason I posted this problem, though, is that I want to understand > *why* I'm getting the "Lost connection to MySQL server during query" e

Re: [PHP] losing mysql connection during cron job

2008-06-18 Thread Paul Novitski
At 6/18/2008 04:49 PM, Shiplu wrote: 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_connec

Re: [PHP] losing mysql connection during cron job

2008-06-18 Thread Shiplu
> > 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

[PHP] losing mysql connection during cron job

2008-06-18 Thread Paul Novitski
I've got a simple script running as a cron job that's getting intermittent "Lost connection to MySQL server during query" errors. The script sends out listserve messages, 50 BCCs each minute, sleep()ing for 60 seconds between sends and updating a data table after each send. The whole BCC list