##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 '