Jump to content

[SOLVED] db question


runei

Recommended Posts

You couldn't really do that with php, as the page would hang until the script had been parsed. All you'd be doing with a 2 second pause would be making the page hang for longer.

 

You might want to use javascript to reveal a hidden div every two seconds or something though.

 

Edit: Well...I suppose you could do it with output buffering, but it wouldn't be as reliable as javascript.

Link to comment
https://forums.phpfreaks.com/topic/155366-solved-db-question/#findComment-817419
Share on other sites

Surely javascript would be more reliable?

Fore example, with output buffering, it would only display the page up to the point that had been parsed when you echo the buffer contents. So if you have a footer or something, it won't be displayed until everything else has been.

Link to comment
https://forums.phpfreaks.com/topic/155366-solved-db-question/#findComment-817436
Share on other sites

Personally i am quite ignorant here. I am looking in to both and i'll see what i come up with. This looks pretty much what i am after. havent tested it yet though.

 

<?php

if (ob_get_level() == 0) ob_start();

for ($i = 0; $i<10; $i++){

        echo "<br> Line to show.";
        echo str_pad('',4096)."\n";   

        ob_flush();
        flush();
        sleep(2);
}

echo "Done.";

ob_end_flush();

?>

Link to comment
https://forums.phpfreaks.com/topic/155366-solved-db-question/#findComment-817448
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.