Hello, folks.
I do have another issue here, haha.
My Cancel script is not working, is not returning the tickets back to the database after I cancel them.
I got completely wrong here, some help would be really appreciated.
<?php
session_start();
$tickets = ['tickets'];
//$tickets = $_SESSION['tickets'];
//$id = $_SESSION['showingID'];
$conn = mysql_connect("localhost", "root", "") or die("cannot connect");
mysql_select_db("DamnTheseTickets") or die (mysql_error());
$sql = "SELECT * from mybookings where username ='$_SESSION[gatekeeper'";
$sql = "DELETE from mybookings where username = '$_SESSION[gatekeeper]'";
$result = mysql_query ($sql) or die(mysql_error());
if($result == FALSE)
{
die(mysql_error()); // TO DO: better error handling
mysql_query("COMMIT");
}
else
{
echo "Your booking has been deleted";
$sql = "UPDATE filmshowings SET maxtickets = maxtickets + $tickets WHERE showingID = $id";
}
?>