forked from danishsshaikh/KCCafeteria
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuyme.php
More file actions
24 lines (21 loc) · 680 Bytes
/
buyme.php
File metadata and controls
24 lines (21 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$i_name = ('item_name');
$i_quantity = ('item_quantity');
$i_price = ('item_price');
$i_id = ('item_id');
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "cart";
$conn = new mysqli($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()) {
die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
} else {
$sql = "INSERT INTO tbl_order (itemname, itemquantity, itemprice, itemid) values ('$i_name','$i_quantity','$i_price','$i_id')";
if ($conn->query($sql)) {
header("location: lastpageFINAL.php");
} else {
echo "Error: " . $sql . "" . $conn->error;
}
$conn->close();
}