首页 > 技术文章 > sql语句异常向数据库插入数据报错

lspis 2021-06-10 17:58 原文

在php编程向数据库插入数据时报如下错误:

[Err] 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 ------
这种异常通常是sql语句出错,根据报错提示找到相应的Line。

我的报错原因是出现了乱码,数据库字段名使用了中文,在换成英文后报错解决。

推荐阅读