If I have a script like this:
$sql = "SELECT * FROM table WHERE Status='0'"; $query = mysql_query($sql); while ($row = mysql_fetch_array($query)) $id = $row['ID']; //......... if($process->send()) { //after sent mysql_query("UPDATE table SET Status ='1' WHERE ID = '$id'"); } }
Therefore, it will update every line when the process is complete. But if I have more than ten thousand records with Status='0' , the update will be slow.
So, is there a better way to update a record? I cannot update everything with a single request, since I need to know if each process is running or not.
Thanks.
source share