php - Real time loop issue -
php - Real time loop issue -
i having problem archiving real time loop. while going next iteration, should check status first update (status= 0) before going next iteration.
status field might updated somewhere else...
for example:
<?php $sql = "select * info status = 0"; $query = $db->prepare($sql); $query->execute(); while ($row = $query->fetch(pdo::fetch_assoc)) { print_r($row); print("\n\n"); sleep(5); } ?> while php script running/looping, in mysql console, did:
update info set status = 1 it still showing records have updated status. how can problem fixed?
the result set computed once. if want see intermediate updates, need issue select statement.
php mysql pdo
Comments
Post a Comment