Commit c315b430 authored by sam.markey's avatar sam.markey

adding the items on the receipt script

parent 9f5eba40
<?php
if(isset($_POST['bookingID']) && isset($_POST['itemName'])&& isset($_POST['itemQuantity'])){
require_once 'connect_db.php';
$itemQuantity = htmlspecialchars($_POST['itemQuantity']);
$itemName = htmlspecialchars($_POST['itemName']);
$bookingID = htmlspecialchars($_POST['bookingID']);
$stmt = mysqli_stmt_init($connect);
$sql = 'INSERT INTO `items_on_receipt_museum`(receipt_bookingID,item_name,item_quantity) VALUES (?,?,?)';
if(!mysqli_stmt_prepare($stmt,$sql)){
echo 'failure';
}
else{
mysqli_stmt_bind_param($stmt,'isi',$bookingID,$itemName,$itemQuantity);
mysqli_stmt_execute($stmt);
echo 'success';
}
mysqli_stmt_close($stmt);
}
else{
echo 'check_isset';
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment