pymysql模块:执行数据操作,pymysql.err.InternalError: (1054,Unknown column XXX field list) sql语句出错

pymysql模块:执行数据操作,pymysql.err.InternalError: (1054, “Unknown column ‘’ in ‘field list’”)
sql语句出错

sql = “INSERT INTO table1(word) VALUES (%s)” % (str)

改为

“INSERT INTO table1(word) VALUES (’%s’)” % (str)

只要是values里面的值,都需要加“”

你可能感兴趣的:(pymysql模块:执行数据操作,pymysql.err.InternalError: (1054,Unknown column XXX field list) sql语句出错)