问题代码:
MySQLdb._exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to you
r MySQL server version for the right syntax to use near 'read,mention) values ('家长偏心对孩子的影响有多大',15424499,5655)'
at line 1")
首先分析报错信息:MySQLdb._exceptions.ProgrammingError是 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
所以我就首先检查了sql语句,当我在navicat中运行我的sql语句是发现:
很明显,里边的read是关键字索引报错了。
解决方法:把items中key值改其他的。