I had a problem with submitting the data in MySql database, my code has no error, but when I check the database it seems like there is no submitting of data in the table
this is my php code
if(isset($_GET['date'])){
$date = $_GET['date'];
}
if(isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$timeslot = $_POST['timeslot'];
$mysqli = new mysqli('localhost', 'root', '*******', 'odpas');
$stmt = $mysqli->prepare("INSERT INTO 'bookings' ('name', 'email', 'date', 'timeslot') VALUES (?,?,?,?)");
$stmt->bind_param('ssss', $name, $email, $date, $timeslot);
$stmt->execute();
$msg = "<div>Booking Successfully</div>";
$stmt->close();
$mysqli->close();
}
here is the form
<form action="" method="post">
<h4>Booking: <p id="slot"></p>
</h4>
<label> Name </label>
<input required type="text" name="name">
<label> Email </label>
<input required type="email" name="email">
<label> TIMESLOT </label>
<input required type="text" readonly name="timeslot" id="timeslot">
<button type="submit">
SUBMIT
</button>
</form>
the codes aren't separated, when I click the button "submit" it looks like it's working but when I check the database there's no submitting of data.
Thank you very much for your help!