这是在数据库的“产品”表中插入某些产品的查询。
变量$insert_pro
行的粗体行不起作用并在'insert into'
工作良好时将数据保存在表格中..请帮我找错误
$insert_product = "INSERT INTO products (product_cat, product_brand,
product_title, product_price, product_desc, product_image, product_keyword)
= VALUES ('$product_cat', '$product_brand', '$product_title',
'$product_price', '$product_desc','$product_image', '$product_keyword')";
**$insert_pro = mysqli_query($con, $insert_product);**
if($insert_pro) {
echo "<script>alert('Product has been inserted')</script>";
echo "<script>window.open('insert_products.php', '_self')</script> ";
}
答案 0 :(得分:0)
问题似乎是&#34; =&#34;在查询中的VALUES前签名
INSERT INTO products (product_cat, product_brand,
product_title, product_price, product_desc, product_image, product_keyword)
= VALUES ('$product_cat', '$product_brand', '$product_title',
'$product_price', '$product_desc','$product_image', '$product_keyword')