I have problem updating my MySQL database. The user can edit a form in my page and once they press 'send', the php script should be able to update all the information. However the database doesn't seem to be updated after pressing the 'send' button in the form but only redirect it self to admin.php.
Somehow only the last line took effect. Is there something wrong with my SQL statement?
Any help would be appreciated! :)
if(isset($_POST["action"])&&($_POST["action"]=="update")){
$query_update = "UPDATE `item_record` SET ";
$query_update .= "`item_name_chi`='".$_POST["item_name_chi"]."',";
$query_update .= "`item_name_eng`='".$_POST["item_name_eng"]."',";
$query_update .= "`item_price`='".$_POST["item_price"]."',";
$query_update .= "`item_comment`='".$_POST["item.comment"]."',";
$query_update .= "`item_avai`='".$_POST["item.avai"]."',";
$query_update .= "WHERE `item_id`=".$_POST["item_id"];
mysql_query($query_update);
header("Location: admin.php");
}