"Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave (Name, Reason, DueDate) VALUES ('Test','Test','02-02-2010')' at line 1"
Yet the code I am using is correct, as I use the exact same syntax in many other pages, and it works fine! Here is my code:
Code: Select all
<?php
include('connect.php');
$leave = "INSERT INTO leave (Name, Reason, DueDate) VALUES ('$_POST[Name]','$_POST[Reason]','$_POST[Due]')";
if (!mysql_query($leave))
{
die('Error: ' . mysql_error());
}
header("location:home.php");
mysql_close();
?>