I am trying to insert a list into my SQLite database but it keeps coming up with sqlite3.OperationalError: near "in":
syntax error.
The list generates fine but it just won't insert.
I am trying to get the list to show up in a single column in the table as the smoking fox x 4 the chicken tinga torta x 2
Here's my code for inserting the list
order_list = []
for sandwich in order_details:
if sandwich[0] == 1:
order_list.append("The Smoking fox x " + str(sf))
if sandwich[0] == 2:
order_list.append("The Chicken Tinga Torta x " + str(ct))
if sandwich[0] == 3:
order_list.append("The Italo Disco Club x " + str(id))
if sandwich[0] == 4:
order_list.append("The Bomb x " + str(bo))
if sandwich[0] == 5:
order_list.append("Falafel burger x " + str(fa))
print(order_list)
sql = """insert in orders (order,) values(?,)"""
cur.execute(sql, (order_list,))
con.commit()
flash("Order submitted")