I am trying to pass the name of the table and information to be inserted into the table as parameters. The query I have come up with is below:
sql = """INSERT INTO `%s` (title,link,description) VALUES(%%s,%%s,%%s)""" % (feed,title_xml,link_xml,description_xml)
cursor.execute(sql)
However, I am getting the following error:
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
What could be wrong here?