Loans - Auto Loans - Home Insurance - Pacotes Porto Seguro - eHarmony

PDA

View Full Version : Displaying parts of a page while the page is not complete yet


wutzmanaym
Mar 23rd 2007, 12:58 pm
A script I'm writing outputs a HTML table with many rows. Each row is the result of a query which takes about one minute to perform. When I run the script in a browser, the page takes several minutes to load and then displays the entire table. Is it possible (using PHP) to display the table as it gets constructed, one row at a time?

A page that does this is http://www.b3ta.cr3ation.co.uk/site/music-plus/ but I don't know if it uses PHP for this.

Houdas
Mar 23rd 2007, 1:35 pm
Do you use output buffering? You can also try the flush() function.

wutzmanaym
Mar 23rd 2007, 4:35 pm
Wow, thanks a lot, exactly what I needed. I'm calling ob_flush() and flush() now, and it works perfectly :)