尝试将数据插入数据库时 出现此错误您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册以获取正确的语法,以便在 'add (price, catID, subCatID, title, description) VALUES ('1500', '1', '1', 'aaa'' at line 1
这是我的代码。你能帮我解决这个问题吗?
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']);
我在这里包含了相关代码
$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());
}