I'm getting this error when trying to insert data into the database 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 'add (price, catID, subCatID, title, description) VALUES ('1500', '1', '1', 'aaa'' at line 1
Here is my code. Could you please help me to solve this problem.
require "dbConnect.php";
dbConnect();
$category = mysql_real_escape_string($_POST['catID']);
$sub_category = mysql_real_escape_string($_POST['subCatID']);
$title = mysql_real_escape_string($_POST['title']);
$description = mysql_real_escape_string($_POST['description']);
$price = mysql_real_escape_string($_POST['price']);
I have included the relevant code here
$insert_data = mysql_query("INSERT INTO add (price, catID, subCatID, title, description) VALUES ('$price', '$category', '$sub_category', '$title', '$description')");
if($insert_data === FALSE)
{
die(mysql_error());
}