matpac4@gmail.com wrote:
Quote:
Thanks Jerry - that is what I thought but I've been getting so many
errors when I try and put it into the loop - I just can't place it
correctly.
>
Could you show me? Would help a lot
>
RE: timeout issues - do you know how I can stop that from happening -
at some days there may be 500,000 items being sent with responses
needed back and to be stored
>
Thx
|
Nothing special about it - just something like:
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$items = "{$row['domain']} <br>";
// Format the data in $row as necessary here
// and put it in $itementer
fputs($fp, "$itementer\r\n");
$remote_server_response = fgets($fp, 128);
// parse the response here and place it in the database
}
If you have the proper authority, you can use ini_set to set
max_execution_time to 0 (disabled).
However, with 500K items, you're going to take a long time. You can run
into things like database or socket timeouts or all kinds of other
possibilities. And what do you do if you process 495,000 rows and get a
failure?
I think your error detection/recovery code is going to be even bigger
than your "work" code.
I know you didn't ask, but personally, I probably wouldn't do this in
PHP. I'd look at something like C or C++. Faster and lighter load on
the system.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================