Chris Stormer
asked on
Timing on a loop..
$result = mysql_query($query);
echo mysql_error();
while($row = mysql_fetch_array($result) ){
$search = $row[0];
echo $search;
I have this. The final result will be different but I will be able to illustrate my question. I want to loop the results one by one, one every 15 second and then the next row. What would be the best way to do this? For the end result I'll strictly be doing stuff that doesn't display on the screen but I'm not sure what the consequences are of running a loop with potentially thousands of records in a database.
.. Is it even possible to add timing to a php while loop..
echo mysql_error();
while($row = mysql_fetch_array($result)
$search = $row[0];
echo $search;
I have this. The final result will be different but I will be able to illustrate my question. I want to loop the results one by one, one every 15 second and then the next row. What would be the best way to do this? For the end result I'll strictly be doing stuff that doesn't display on the screen but I'm not sure what the consequences are of running a loop with potentially thousands of records in a database.
.. Is it even possible to add timing to a php while loop..
ASKER
This does work, when it's finish with the whole query it displays.
What are the concequences of running this against a few thousand records?
What are the concequences of running this against a few thousand records?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
echo mysql_error();
while($row = mysql_fetch_array($result)
$search = $row[0];
echo $search;
sleep(15);
}