|  | Posted by Julie on 11/25/05 02:05 
Thanks for your great response.That makes sense.  I tried to put some output in the loop that goes through
 each record, but it seems that the delay is before that, perhaps here:
 // delay is with this command
 $theresults=mysql_query( $sql )
 
 //then it is ok here and processes loop quickly
 while( $row = mysql_fetch_object( $theresults ) )
 
 
 I think it is because it is loading in over 80000 records from mysql
 database in this query?
 Is there a command  or other method I can use that will not load the whole
 dataset at once, but only one record at a time?  Please assist
 
 Thanks so much
 
 Julie
 
 
 
 "J.O. Aho" <user@example.net> wrote in message
 news:3ulqfaF11rtk8U1@individual.net...
 > Julie wrote:
 >> I have a very large php script that processes a database.
 >> The script works at times, but then other times in IE, it will say
 >> "website
 >> found, waiting for reply"
 >> then say "done", then show the error page.
 >> 1. What is causing this?  It seems when I clear out my cache, it may
 >> work.
 >> The script takes about 2.5 minutes to run and is it because for some
 >> reason,
 >> IE doesnt want to wait and is refreshing the page?
 >
 > Browser timeout, the browser will not stay and wait for a page without any
 > output for ever. If you have a script that does a lot of background job,
 > you
 > need to make it to output something once in a while so that the browser
 > won't
 > think that the server timed out and break the loading, which leads to that
 > the
 > execution of the php script is terminated.
 >
 >
 >> 2. How can I set this script to run on the server with a cron job.  It
 >> needs
 >> to launch this php script, and then close it.
 >> I am on an apache server
 >
 > You need to modify the /etc/crontab on the machine that you have the php
 > script on, for details how to set up a correct crontab line, you should
 > read
 > the man page (man crontab)
 >
 > You need to make the php script to be executive, you will need to tell the
 > script where to find the php binary, eg:
 >
 > #!/usr/bin/php
 >
 >
 > --- example script ---
 > #!/usr/bin/php
 > <?PHP
 > echo date('Y-m-d');
 > ?>
 > --- end of file ---
 >
 > When you have your script, you have to set the executive bit on
 >
 > chmod 755 /path/to/the/script.php
 >
 > This makes it's read/write/exec byy the owner, read/exec by the group and
 > read/exec by everyone else.
 >
 >
 > //Aho
  Navigation: [Reply to this message] |