-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_rule_book_insert_code.php
More file actions
37 lines (32 loc) · 1.34 KB
/
add_rule_book_insert_code.php
File metadata and controls
37 lines (32 loc) · 1.34 KB
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
<?php
session_start();
include 'connection_DB.php';
if (isset($_POST['done'])) {
$book_title = $_POST['book_title'];
$author = $_POST['author'];
$translator = $_POST['translator'];
$publish_place= $_POST['publish_place'];
$publisher= $_POST['publisher'];
$publish_year= $_POST['publish_year'];
$volume= $_POST['volume'];
$book_edition= $_POST['book_edition'];
$page= $_POST['page'];
$case_id = $_POST['case_id'];
$row = $_POST['row'];
$column = $_POST['column'];
$copy_id = $_POST['copy_id'];
$sql = 'SELECT * FROM book_case WHERE book_case_id = "'.$case_id.'" AND c_row = '.$row.' AND c_column = "'.$column.'"';
$res = mysqli_query($con, $sql);
while($row = mysqli_fetch_assoc($res)){
$b_c_id = $row['b_c_id'];
}
$sql = "INSERT INTO `rule_book`(`book_title`,`author`, `translator`,`publish_place`, `publisher`,`publish_year`,`volume`, `book_edition`,`page`, `b_c_id`,`copy_id`)
VALUES ('$book_title','$author','$translator',' $publish_place','$publisher','$publish_year',' $volume',' $book_edition','$page','$b_c_id','$copy_id')";
$query = mysqli_query($con,$sql);
if($query){
header("location:add_rule_book.php?Data_Inserted");
$_SESSION['response']="Data Saved Success!";
$_SESSION['res_type']="success";
}else{ echo "faild";}
}
?>