Welcome Guest, Not a member yet? Register   Sign In
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 );
}




Theme © iAndrew 2016 - Forum software by © MyBB