I keep getting
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 ‘ID, Product Name, Description, Price, Location) VALUES (’’,’’,’’,’’,’’)’ at line 1can any one help?
Here is the code:
PHP:
[php]<?php
$con = mysql_connect(“mysql3..com",“a3590170_*****”,"”);
if (!$con)
{
die('Could not connect: ’ . mysql_error());
}
mysql_select_db(“a3590170_***”, $con);
$sql=“INSERT INTO oms (Product ID, Product Name, Description, Price, Location)
VALUES
(’$_POST[ProductID]’,’$_POST[ProductName]’,’$_POST[Description]’,’$_POST[Price]’,’$_POST[Location]’)”;
if (!mysql_query($sql,$con))
{
die('Error: ’ . mysql_error());
}
echo “1 record added”;
mysql_close($con);
?> [/php]
HTML:
[code]
Product ID:
Product Name:
Price:
Location:
[/code]