I
I
inbsk2019-08-18 14:15:15
Python
inbsk, 2019-08-18 14:15:15

How to use two variables when updating data in sqlite3?

I am writing python code using sqlite3 database. I had a question about updating data using two variables at once.
I tried using the following:

cur.execute("""UPDATE main_table SET cocospalm = cocospalm + ? WHERE user_id=?""", bp, (str(chat_id),))

But it throws an error:
TypeError: function takes at most 2 arguments (3 given)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question