• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long running script needs love

#1
[eluser]Chris Williams[/eluser]
I'm running a script that does some clean up to my database. It's a loop that will time out.

How can I tell my script to output updates?

I put in echo statements, but they don't load into the page until the page has already timed out.

#2
[eluser]manilodisan[/eluser]
use ob_flush(); and flush(); after each echo...
Code:
for ( $i=0; $i<100; $i++ )
{
    echo $i . '<br />';
    ob_flush ();
    flush ();

    usleep ( 300000 );
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.