-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_book.php
38 lines (37 loc) · 946 Bytes
/
delete_book.php
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
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require('./include/config.php');
require('./include/init.php');
require('./include/public_fun.php');
/**
* 删除手册
*/
class Delete_book extends Public_fun
{
public function __construct()
{
$this->must_login();
$this->get_book_id();
$this->delete_article();
$this->delete_book();
header('location:./');
}
/**
* 删除文章数据(必须先删除文章,再删除手册信息)
*/
public function delete_article()
{
$table = Config::$table['article'];
$sql = "DELETE FROM `$table` WHERE `book_id` = {$this->book_id}";
mysqli_query(Init::$conn, $sql);
}
/**
* 删除手册信息
*/
public function delete_book()
{
$table = Config::$table['book'];
$sql = "DELETE FROM `$table` WHERE `id` = {$this->book_id}";
mysqli_query(Init::$conn, $sql);
}
}
$delete_book = new Delete_book();