Displaying parts of a page while the page is not complete yet

Discussion in 'PHP' started by wutzmanaym, Mar 23, 2007.

  1. #1
    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.
     
    wutzmanaym, Mar 23, 2007 IP
  2. Houdas

    Houdas Well-Known Member

    Messages:
    158
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    Do you use output buffering? You can also try the flush() function.
     
    Houdas, Mar 23, 2007 IP
  3. wutzmanaym

    wutzmanaym Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Wow, thanks a lot, exactly what I needed. I'm calling ob_flush() and flush() now, and it works perfectly :)
     
    wutzmanaym, Mar 23, 2007 IP