mysql插入报错有关问题
程序员文章站
2022-05-24 12:44:55
...
mysql插入报错问题
INSERT INTO `Sale_Order` (`id`,`number`,`order_id`, `order_status`, `buyer_name`, `buyer_email`, `buyer_phone_number
`, `total_price`, `currency`, `phone`, `postal_code`, `recipient_name`, `ship_address`, `ship_state`
, `city`, `country`, `account`, `lastup_date`, `payments_date`, `delivery_date`, `download_date`, `delivery_warehouse
`) VALUES (NULL,'1','249-4503994-1570232','2','杉本 圭\',[email protected]','','1000
.00','JPY','','225-0003','ローソ\ンL たまプラーザ駅南口','横浜市青葉区新石川3‐15‐2 ','神奈川県','--','JP','JP_John','','2015-03-27T20
:43:50+09:00','',NOW(),'FBA')
以上报错
#1064 - 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 [email protected]','','1000 .00','JPY','','225-0003','??' at line 2
插入之前都转了UTF-8的,请问这里面,哪有问题??
------解决思路----------------------
先用mysql_real_escape_string做一次转义
INSERT INTO `Sale_Order` (`id`,`number`,`order_id`, `order_status`, `buyer_name`, `buyer_email`, `buyer_phone_number
`, `total_price`, `currency`, `phone`, `postal_code`, `recipient_name`, `ship_address`, `ship_state`
, `city`, `country`, `account`, `lastup_date`, `payments_date`, `delivery_date`, `download_date`, `delivery_warehouse
`) VALUES (NULL,'1','249-4503994-1570232','2','杉本 圭\',[email protected]','','1000
.00','JPY','','225-0003','ローソ\ンL たまプラーザ駅南口','横浜市青葉区新石川3‐15‐2 ','神奈川県','--','JP','JP_John','','2015-03-27T20
:43:50+09:00','',NOW(),'FBA')
以上报错
#1064 - 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 [email protected]','','1000 .00','JPY','','225-0003','??' at line 2
插入之前都转了UTF-8的,请问这里面,哪有问题??
------解决思路----------------------
先用mysql_real_escape_string做一次转义
$name = mysql_real_escape_string($name);
$sqlstr = "insert into table(`name`) values('".$name."')";
相关文章
相关视频
推荐阅读
-
解决php用mysql方式连接数据库出现Deprecated报错问题
-
JSP MySQL插入数据时出现中文乱码问题的解决方法
-
java实现插入mysql二进制文件,blob类型,遇到问题及解决办法
-
浅谈mysql密码遗忘和登陆报错的问题
-
浅谈mysql密码遗忘和登陆报错的问题
-
使用cmd运行mysql数据库的时候,报错:"不是内部命令也不是可有运行的程序"问题的解决办法
-
MySQL插入时间差八小时问题的解决方法
-
mysql数据库使用insert语句插入中文数据报错
-
mysql报错1033 Incorrect information in file: ‘xxx.frm’问题的解决方法
-
一键搞定python连接mysql驱动有关问题(windows版本)