##delete.php:
include_once("conn\conn.php");
if (is_array($_POST['id'])) {
$id = join(',', $_POST['id']);
} elseif (is_numeric($_GET['id'])) {
$ id = (int) $_GET['id'];} else {
echo '資料不合法';
exit;
} $sql = "從padd 移除where id in($ id )";
$result = mysqli_query($connID, $sql);
if ($result) {
echo '成功刪除';
} else {
echo '刪除失敗' ;
}
?>
index.php如下:
#
include_once("conn\ conn.php ");
$sql = "根據id desc 從padd 順序選擇*";
$result = mysqli_query($connID, $sql);
if ($result && mysqli_num_rows($result) ) ) {
echo '