This question already has an answer here:
Anyone know what is wrong with the code below and why i get the following error: Error in query: 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 'Update)VALUES ('')' at line 1.
The php code is
<?php
mysql_connect("localhost" , "" , "") or die (mysql_error());
mysql_select_db("") or die(mysql_error());
/* Now we will store the values submitted by form in variable */
$Update=$_POST['Update'];
$query = ("INSERT INTO Information (Update) VALUES ('$Update')");
$result = mysql_query($query) or die("Error in query: ". mysql_error());
echo "Success";
mysql_close();
?>
and the html is
<form method="POST" action="info.php"> <!-- opens form -->
<table border="0"> <!-- opens table -->
Informaiton:<input type="text" name="Update" />
<br />
<input type="Submit" value="Submit" /> <!-- submits details -->
</table> <!-- closes table -->
</form> <!-- closes form -->
The table in my database is called Information and the column is called Update.
Thanks!
</div>