The code below is supposed to connect to an application and insert data into the database that has been entered from the user. However I get a strange error when I run the code it says 'Parse error: syntax error, unexpected 'Insert' in...'. To me this error is telling me that the echo 'Insert successful', is somehow causing the code to crash, am i misinterpreting what the error is saying? Could someone show me how I can fix the code?
<?php
require "conn.php";
$patient_name = $_POST["patient_name"];
$doctor_name = $_POST["doctor_name"];
$check_in_date = $_POST["check_in_date"];
$room_number = $_POST["room_number"];
$bed_number = $_POST["bed_number"];
$notes = $_POST["notes"];
$time = $_POST["time"];
$mysql_qry = "insert into patients2
(patient_name, doctor_name, check_in_date, room_number, bed_number, notes, time)
values ('$patient_name', '$doctor_name', '$check_in_date', '$room_number', '$bed_number', '$notes', '$time';);
if($conn->query($mysql_qry) === TRUE) {
echo "Insert successful";
}
else{
echo "Error: " . $mysql_qry . "<br>" . $conn->error;
}
$conn->close();
?>