MySQL output CSV and update from CSV

Arbiniknids

New Member
I have a query below where I select a single ID from my database, then update a field for that ID with a 1 to indicate that this record has been processed. I now need to perform the same process but select 50 ID's and output them in CSV format, and again update each record with a 1 to indicate that these records have been processed. Any help is appreciated, I'm not sure on the most efficient method to do this.\[code\]$result = mysql_query("SELECT `id` FROM `t_ids` WHERE `f_fetched` IS null LIMIT 1");while($row = mysql_fetch_array($result))$f_id = $row['id'];mysql_query("UPDATE t_ids SET f_fetched = '1' WHERE id = '$f_id'");\[/code\]
 
Top