printing a loop

When you loop an array, is there a way to print each item when you get them or does the whole loop has to finish before all the printing occurs?

For example, take the loop below

[php]<?php
while($list = mysql_fetch_array($down_dates) )
{
echo $list[‘down_date’];
}
?>[/php]

If the retrieved data is large, it takes a long time to load the page, I would like to print each item as they come.

Is that possible?

normaly it should work that way.

try:
[php]<?php
while($list = mysql_fetch_array($down_dates) )
{
echo $list[‘down_date’];
flush();
}
?>[/php]

http://php.net/flush

Thanks for your reply but it still finishes the loop before the page shows.

what server are u running?

some would flush the buffer, maybe it need some configuraqtion.

Sponsor our Newsletter | Privacy Policy | Terms of Service