I have a table with about 450,000 row. The table needs some derived fields updated.
My loop is:
$sql = "SELECT * FROM table_name";
if (!($r = @ mysql_query($sql, $db_connection))) die("Mysql query $sql . Error " . mysql_errno() . " : " . mysql_error());
while ($row = mysql_fetch_assoc($r))
{
// do a number of calculations, which create some $sql to update the record
$sql .= " WHERE p_id = $id"; // $id is the records id
if (!($result = @ mysql_query($sql, $db_connection))) die("Mysql query $sql . Error " . mysql_errno() . " : " . mysql_error());
}
This code is not getting through all the records. The php script is called from within a web page, and the web page does not respond. When I look at the table it has updated about 60,000 and the rest fo the records are un-tounched.
This used to work fine, but since I upgrade Ubuntu to the latest version this is happening. I tried increasing memory in php.ini but that has not worked.
Ideas anyone?