简体   繁体   中英

Python SQlite3 Update function, sqlite3.OperationalError: near “WHERE”: syntax error

I'm trying to update an item in my database for the relevant field which is identified by an OrderID.

 cursor.execute("UPDATE Customer_Orders SET Progress=?, WHERE OrderID=?", 
 ("Completed", tableOrderInfo[0],))

However, I keep getting this syntax error and I don't know why.

 sqlite3.OperationalError: near "WHERE": syntax error
UPDATE Customer_Orders SET Progress=? WHERE OrderID=?

remove the comma before WHERE.

See more about UPDATE in SQL here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM