I'm running PHP 5.0 beta 3, and I have seen script timeout errors before. It's just odd that I wasn't receiving them this time. Increasing the timeout helped, but didn't fully correct the problem. I just kept changing the SQL statement to "WHERE user_key >= [id number where it left off]" so that it would send in batches and not send to the same people twice.

I didn't code this originally or I would've used a SQL JOIN to combine two tables of data instead of hitting the database a second time for each record encountered as my other programmer did. So, I'm going to revise the scripts for future use and then do as someone said and save all the e-mail addresses to an array (and perhaps even free the result set) before sending.

Thanks!

-Ben


Marek Kilimajer wrote:


You should. I know I did in older version of php, now I don't.

Ben Ramsey wrote:

Ah... I was trying to lookup the word "timeout," which was giving me nothing. Thanks! Also, shouldn't I be receiving an error message if the script is, in fact, timing out? I have checked "display_errors" and it is turned on.



[EMAIL PROTECTED] wrote:

Hello Ben,

On 27 Jan 2004 at 9:27, Ben Ramsey wrote:


I'm trying to run a query against a database with a PHP script that cycles through each record (about 4,000+) and sends and e-mail to them if they have an e-mail address present. The problem is that everytime I do this, it processes about 430 records and stops. There is no error message generated. Could this be due to a script timeout? If so, how do I raise the timeout value?




Look up set_time_limit in the PHP manual. Also, consider retrieving all the records first with a single db query, storing all e-mails in an array, and then sending out the e-mails in a separate operation. Why query your db 4000+ times when you can query it only once?

Good luck,

Erik




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to