query($sql); if (mysql_num_rows($rs) == 0) { header("Location: ../error.php"); exit; } } else { header("Location: ../error.php"); exit; } getpost(); if ($bthUpdate) { $count = 1; if (!empty($sorting_id)) { foreach($sorting_id as $theid) { $thesorting = ${"sorting_".$count}; $sql = "UPDATE `".$page_tbname."` SET `sorting` = '".escapeit($thesorting)."' WHERE `id`='".$theid."'"; $db->query($sql); $count++; } } $updated = 1; } if ($bthDelete) { if (!empty($selectRecord)) { foreach ($selectRecord as $key => $value) { $sql = "DELETE FROM `".$page_tbname."` WHERE `id` = '$value'"; $db->query($sql); del_all_attachment($page_tbname,$value); } } $updated = 2; } header("Location: ".$page_address_list."?keepSession=1&page=$page&updated=".$updated); exit; ?>