国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

PHP ?? ?? ????: ??? ?? ?? ? ?? ??

?????? ?? ?? ???

?? ??????? ???? ??? ??? ????, ????, ?????? ?? ?? ??? ?????.
??? ???? ???, ?????? ??? ?? ??? ?????, ??? ?? ????? ?? ?????? ??? ??? ?? ????.

?? ?? ????? ??????? ???? ???. ?? ??? ??? ????, ??? ????, ?? ??? ???? ??? ?? ?? ??????. ??? ??? ??? ????? ?? ??? ?? ????.

?? ??? ??? ?? ??? ???? ??? ??? ? ????. ?? ??? ??? ????.

118.png

??? ?? ?? config.php? ?? ? ????. ??? ???? ?? ?? ??? ?????. ??? ??? ????.

<?php
//數(shù)據(jù)庫服務(wù)器
define('DB_HOST', 'localhost');

//數(shù)據(jù)庫用戶名
define('DB_USER', 'root');

//數(shù)據(jù)庫密碼
define('DB_PWD', 'secret');

//庫名
define('DB_NAME', 'book');

//字符集
define('DB_CHARSET', 'utf8');

??? ?????. Connection.php ????? ??? ??????? ???? ?? ???? Connection.php ??? ???? ???. ??? ??? ????.

<?php

include 'config.php';

$conn = mysqli_connect(DB_HOST, DB_USER, DB_PWD, DB_NAME);

if (mysqli_errno($conn)) {
    mysqli_error($conn);
    exit;
}

mysqli_set_charset($conn, DB_CHARSET);

?? ? ??? Connection.php ??? ?? ???? ?????? ??? ??? ? ????.

include 'connection.php';

?? ??? ??? ?, ??? ??


???? ????? ???? ????? ???? ??? ?? ?? ???? ?????.

get? ?? ????? ???? ? ?? ?? ID? delete.php ??? ???.

??? ?? ? ???? ?? ID? POST? ?? delete.php ???? ?????.
  • ? ? ? ?? ?? ???? ??? ?? ???? ?????.
  • ???

??? SQL?


?? MySQL ??? ??? ? in ?? ?? ??? ? ??? ??????.

????? ????? in ?? ?? ???? ??? ?? ? ????.

join ??? ?? ?? ??? ??? id? 3, 4, 5? ???? ?????. ?? ?? ??? SQL ?? ??? ?? ???

if (is_array($_POST['id'])) {

    $id = join(',', $_POST['id']);

} elseif (is_numeric($_GET['id'])) {

    $id = (int) $_GET['id'];

} else {
    echo '數(shù)據(jù)不合法';
    exit;
}

?? ?? ?? ?? ??? ??? ??? ????.

delete from user where id in(3,4,5,6,8);

??? ???? ?? ?? ? ?? ?? ?? ??? ????.

delete from user where id in(3)

?? ?? ?? ??? ??? ????.

$sql = "delete from user where id in($id)";


???? ??
||
<?php include 'connection.php'; if (is_array($_POST['id'])) { $id = join(',', $_POST['id']); } elseif (is_numeric($_GET['id'])) { $id = (int) $_GET['id']; } else { echo '數(shù)據(jù)不合法'; exit; } $sql = "delete from user where id in($id)"; $result = mysqli_query($conn, $sql); if ($result) { echo '刪除成功'; } else { echo '刪除失敗'; }