我正在尝试将表的名称和要插入到表中的信息作为参数传递。我提出的查询如下:
sql = """INSERT INTO `%s` (title,link,description) VALUES(%%s,%%s,%%s)""" % (feed,title_xml,link_xml,description_xml)
cursor.execute(sql)
但是,我收到以下错误:
Traceback (most recent call last):
File "slicer_1.py", line 41, in <module>
sql = """INSERT INTO `%s` (title,link,description) VALUES(%%s,%%s,%%s)""" %(feed,title_xml,link_xml,description_xml)
TypeError: not all arguments converted during string formatting
这里有什么问题?