Show rows data during loop

Hello Masters

I have a database, and some search operations and process on the data.

Obviously, since there are multiple rows, therefore i am using loop.

Now the problem is that php do not show anything until the loop is ended, and how everything at once at the end of the loop. I do not want this.

I want that the script should continue to show the results as they are processed instead of all the rows at the end of the loop.

Please guide how this can be achieved. \


Take a look at the flush() function :slight_smile:

for example,

while($r = mysql_fetch_object($result))
$data = some_Process($r->serial_code);
echo $data.“<br>”;

It will not give the live response, but it will give all the result when the records are finished. the process, has some interaction with 3rd party API, therefore it takes 2-3 seconds for each row. Therefore, if there are 10 rows, it will show the results of all the 10 rows after 30 seconds. But i want that it should echo the result, as soon as 1 row is processed.

Are you getting my point ? I mean did I explain it clearly ?

Code please?