1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<?php include_once ("check_login.php");
$faq_id = (int)$_GET["faq_id"];
$sql = "select * from faq where faq_id = ?"; $parameters = array($faq_id); $row = bind_pdo($sql, $parameters, "selectone");
$sort = $row{"sort"};
// Delete db $sql = "update faq set deleted = ? WHERE faq_id=?"; $parameters = array("1", $faq_id); bind_pdo($sql, $parameters);
//update sorting $sql = "update faq set sort = sort-1 where sort > ?"; $parameters = array($sort); bind_pdo($sql, $parameters);
$dbh = null;
header("Location: faq_index.php?msg=刪除成功");
|