real_escape_string($drinksName); // Create a DateTime object from the AM/PM time $dateTime = DateTime::createFromFormat('h:i A', $timeSlot); // Convert to 24-hour format $sql = "INSERT INTO aha_preferred_drinks (`aha_user_id`,`drink_id`,`vehicle_plate`) VALUES ('$userID','$drinksID','$plateNo')"; if ($conn->query($sql) === TRUE) { $stat="Thank you! We are delighted to serve you."; } else { $stat="Error, unable to save record. Please contact us via Live Chat Support. Thank you!"; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode(["status" =>$stat]); } // Close connection $conn->close(); ?>