0

I want something like this. But the following does not work The tablename is saved in e, the name of the row in i[0] and the value in k.

"INSERT INTO ? (?) VALUES(?)" (e, i[0], k)

egjada
  • 119
  • 2
  • 12
  • You can't use placeholders for table and column names. You have to use string formatting functions for that, then you can use the result in a prepared statement. – Barmar Jul 14 '17 at 16:46
  • "INSERT INTO {} ({}) VALUES(?)".format(i[e], i[0]), (k) I tried it this way but it didn't work – egjada Jul 14 '17 at 17:00

0 Answers0