|

楼主 |
发表于 2018-6-29 06:11:34
|
显示全部楼层
谢谢回复,现在报错变成了:
- pymysql.err.ProgrammingError: (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 '微信小程序 -
- 庖丁解牛'', ''27'', ''不二如是'')' at line 1")
复制代码
代码是:
- def store_data(self, data):
- result = []
- title, subscription, author = data
- for i in range(len(title) - 1):
- param = [pymysql.escape_string(title[i]), pymysql.escape_string(subscription[i]), pymysql.escape_string(author[i])]
- result.append(param)
- # for t in title:
- # for s in subscription:
- # for a in author:
- sql = '''insert into `taozhuanji` (`title`, `subscription`, `author`) values ('%s', '%s', '%s');'''
- # % (pymysql.escape_string(t), pymysql.escape_string(s), pymysql.escape_string(a))
- self.cursor.executemany(sql, result)
- self.db.commit()
复制代码 |
|