<?php
$query = 'SELECT id FROM transaction_table';
$result = db_query($query);
while($row = db_fetch_array($result)) {
//do some processing
db_query('UPDATE transaction_table SET updated = "1" WHERE id = "%s"',$row['id']);
}
?>
Every time this script run, it only updates a few random rows (8-25 on average). It should be updating all the rows.