<?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.
echo out the query on each loop. My guess is that there are a few that error out. Use this code:
Try running each query manually in MySQL directly and verify each will run. I can’t see anything in the code you gave us that would cause any issues.