Re: case to comment, please

From: Date: Fri, 09 Jan 2004 10:25:55 +0000
Subject: Re: case to comment, please
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-32335@lists.php.net to get a copy of this message
Nabil wrote:
1-the problem is that the 30 second of execution time expired before i can send even 200 records.
http://php.net/set_time_limit Personally I'd call set_time_limit once for each iteration of the loop with a sensible timeout like 30 seconds. Alternatively you can call it once at the start of the script with a timeout of 0 to let it run as long as it needs to.
2- in case of not connection of the remote page, and i did not get the $var1 printed ($data == $var1) then i have to re submit this record.
The for loop doesn't make much sense since $var1/2/3 don't change with each iteration, but assuming $i is used to select the record to send something like this should do the trick... for ($i=0 ; $i<NUM_OF_RECORDS ; $i++) {
    if (!send_rec( $var[$i][0] , $var[$i][1] , $var[$i][2] ))
        $i--; // Redo this record
} I'd suggest you add something to ensure you don't retry the same record forever, but I'll leave that as an exercise for the reader :) -- Stuart

« previous php.db (#32335) next »