iv'e created a database in mySQL with the following as mentioned in the code :
<?php
// Create connection
$con=mysqli_connect("myURL","myUSER","myPassword","NewActivities");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO NewActivities1 (address, title, description, area, category, frequency, when)
VALUES
('$_POST[address]','$_POST[title]','$_POST[description]','$_POST[area]','$_POST[category]','$_POST[frequency]','$_POST[when]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>
i keep getting this error: 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 'when) VALUES('fff','fff','fff','Stockholm','Activities','One time','fff')' at line 1
if i removed the "when" from the query the database gets updated in the mentioned fields.
the field "when" in the form is defined with the attribute "name="when""
what may seem to be the problem?
thank you