connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Retrieve form values
$rotDate = $_POST['rotDate'];
$rotStaffRef = $_POST['rotStaffRef'];
$rotStart = $_POST['rotStarte'];
$rotFinish = $_POST['rotFinish'];
// Prepare and bind SQL statement
$sql = "INSERT INTO users (rotDate, rotStaffRef, rotStart, rotFinish) VALUES (?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ss", $rotDate, $rotStaffRef);
// Execute statement
if ($stmt->execute()) {
echo "Data inserted successfully!";
} else {
echo "Error: " . $stmt->error;
}
// Close connection
$stmt->close();
$conn->close();
?>