query($sql); $id = $db->insert_id(); if($temp_id != ""){ $sql = "UPDATE `attachment` SET `table_id` = '".$id."', `temp_id` = '' WHERE `table_name` = '".$page_tbname."' AND `temp_id` = '".$temp_id."'"; $db->query($sql); } } $tags_each= $tags; if ($tags_each){ foreach ($tags_each as $t){ $tags_id .= $t." "; } } //update $sql ="UPDATE `".$page_tbname."` SET `display`='".escapeit($display)."', `sorting`='".escapeit($sorting)."', `en_exhibitions`='".escapeit($en_exhibitions)."', `en_country`='".escapeit($en_country)."', `en_date`='".escapeit($en_date)."', `en_location`='".escapeit($en_location)."', `cn_exhibitions`='".escapeit($cn_exhibitions)."', `cn_country`='".escapeit($cn_country)."', `cn_date`='".escapeit($cn_date)."', `cn_location`='".escapeit($cn_location)."', `jp_exhibitions`='".escapeit($jp_exhibitions)."', `jp_country`='".escapeit($jp_country)."', `jp_date`='".escapeit($jp_date)."', `jp_location`='".escapeit($jp_location)."' WHERE `id` = '".$id."'"; $db->query($sql); //delete file if (!empty($delfiles)) { foreach ($delfiles as $key => $value) { del_attachment($value, "../../"); } } header("Location: ".$page_address_list."?keepSession=1&page=".$page); exit; ?>