-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
new-php.php
34 lines (28 loc) · 940 Bytes
/
new-php.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
<?php
include_once 'includes/db_connect.php';
if(!$mysqli){
die("Connection failed: " . mysqli_connect_error());
}
$A = $_POST['isbn'];
$B = $_POST['name'];
$C = $_POST['author'];
$D = $_POST['publisher'];
$E = $_POST['print_date'];
$F = $_POST['date_received'];
$G = $_POST['volume'];
$H = $_POST['language'];
$I = $_POST['category'];
$J = $_POST['read'];
$K = $_POST['lend'];
$L = $_POST['lend_to'];
$sql = "INSERT INTO $table_name ($isbn_no, $name, $author, $publisher, $print_date, $date_received, $volume, $language, $category, $read, $lend, $lend_to) VALUES ('$A', '$B', '$C', '$D', '$E', '$F', '$G', '$H', '$I', '$J', '$K', '$L')";
if(mysqli_query($mysqli, $sql)){
mysqli_close($mysqli);
header("Location: new.php");
}
else{
echo "Error: " . $sql . "<br>" . mysqli_error($mysqli);
}
mysqli_close($mysqli);
header("Location: new.php");
?>