$value) { del_attachment($value, "../../"); //--- Delete the attachment --- } } //--- End Delete your select record --- }else if($action == "update"){ //--- Update record --- if (!empty($hid_sorting_id)) { foreach($hid_sorting_id as $key => $theid) { /*$sql = "UPDATE `attachment` SET `sorting` = '".escapeit($sorting_id[$key])."', `attach_caption`='".escapeit($attach_caption[$key])."', `is_main`='".($for_default == $theid ? "Y" : "")."' WHERE `attachment_id`='".$theid."'";*/ $sql = "UPDATE `attachment` SET `sorting` = '".escapeit($sorting_id[$key])."', `attach_caption`='".escapeit($attach_caption[$key])."' WHERE `attachment_id`='".$theid."'"; //echo $sql; $db->query($sql); $count++; } } //--- End Update record --- } //--- End Delete your select record --- header("Location: ./multi_uploadfile.php?temp_id=".$temp_id."&id=".$id."&keepSession=1&page=$page"); exit(); ?>