Hi,
If I change the statement to an insert, it inserts it no problems. If I copy the Update statement that is echoed to the browser and to the SQL window and execute it there, the update statement works (is valid).
I do not get an error message. It just does not update.
foreach( $_POST["updatefood"] AS $key => $value )
{
$new_amount = $_POST["food_amnt"][$key];
$new_gml = $_POST["uf_gml"][$key];
$uf_id = $value;
$user_id = "2";
// $updtsql = "UPDATE `user_food` SET `amount` = '$new_amount', `g_ml` = '$new_gml' WHERE `uf_id` = '$uf_id' AND `user_id` = '$user_id' LIMIT 1 ;";
$updtsql = "UPDATE user_food SET amount = 4, g_ml = 0 WHERE uf_id = 33 AND user_id = 2";
echo "update sql is " . $updtsql . "<BR>";
$result = mysql_query($updtsql, $connection) or die("Query failed : " . mysql_error());
//mysql_query($updtsql, $connection) or die("Query failed : " . mysql_error());
echo "numb of rows added with update " . mysql_affected_rows() . "<BR>";
}
Any tips appreciated.
Thanks,
Sonya