I keep receiving this error, while trying to insert data from Pandas df to SQLite DB: near "?": syntax error. The code snippet looks like this, and in another script, similar idea works fine. My df has 4 columns (int & 3x string), same column names and types are in SQLite table called titles.
conn = sqlite3.connect('test_db_2.db')
c = conn.cursor()
for i in range(len(df)):
try:
c.execute("""INSERT INTO titles (?,?,?,?)""",df.iloc[i,:])
conn.commit()
What could be the cause?