php - MySQL 错误行 1 [INSERT INTO]

标签 php mysql

嗨,我收到了这个错误,这是我的查询

insert into `products` (original_id,name,image_url,buy_url,short_description,long_description,sale_price,retail_price,brand,keyword,category_name,store_name,provider_name) values (5068122-EC1155705-5.5M,Eastland Plainview Shoes (Black) - Women's Shoes - 5.5 M,http://www.shoes.com/productimages/shoes_iaec1155705.jpg,http://gan.doubleclick.net/gan_click?lid=41000000025255752&pid=5068122-EC1155705-5.5M&adurl=http%3A%2F%2Fwww.shoes.com%2FShopping%2Fproductdetails.aspx%3Fcatalog%255Fname%3Dweb%26pg%3D5068122%26p%3DEC1155705&usg=AFHzDLv0Y4C7BN1pbi4RzmWWTgLx7J7uBw&pubid=21000000000526055,Eastland keeps it timeless and classy with these smart and sturdy Plainview oxfords. Soft full grain leather upper in a casual oxford style with a round plain toe. Contouring double stitching and an Eastland side logo tag add classic detail. Five eyelet g,Eastland keeps it timeless and classy with these smart and sturdy Plainview oxfords. Soft full grain leather upper in a casual oxford style with a round plain toe. Contouring double stitching and an Eastland side logo tag add classic detail. Five eyelet grommeted lacing and a smooth leather padded collar and tongue create a comfortable customizable fit. Textile lining and cushioning footbed flexible stitched midsole. Durable polyurethane traction outsole with a sturdy 1 1/4 inch heel.,77.00,77.00,Eastland,Eastland Plainview Shoes (Black) - Women's Shoes - 5.5 M Womens|Casual Eastland US adult Black female  Apparel & Accessories > Shoes   5.5 M,Apparel & Accessories > Shoes,Eastland,gan)

On line: 127 File C:\web\filesearch\index.php 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 'M,Eastland Plainview Shoes (Black) - Women's Shoes - 5.5 M,http://www.shoes.com/' at line 1

这有什么问题吗?

行行:127是这个

  mysql_query($query) or die($query . "<br />On line: " . __LINE__ . " File " . __FILE__ . " " . mysql_error());

最佳答案

将您的字符串值包含在查询的引号中。你有大字符串,但它们周围没有引号,这就是错误。例如5068122-EC1155705-5.5M应该是"5068122-EC1155705-5.5M"或者'5068122-EC1155705-5.5M'

关于php - MySQL 错误行 1 [INSERT INTO],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14435448/

相关文章:

MYSQL 获取存储为字符串的日期和时间并按 ORDER BY

php - 如何知道最近对 MySQL 创建的条目的 id(自增)?

php - Laravel 中缺少文件

php按位标志检测操作

php - mysql查询在php中存储字符串数组SQL语法错误

mysql - 显示存在值的表名

php - Symfony 2 - 如何删除一个包?

javascript - 单页网站 ~ 关于索引和社交媒体共享的最佳实践和方法

php - 单击按钮时触发 jquery validate()

mysql - SQL 查询 reg.ex。匹配