V
V
Vladislav2021-12-08 15:15:01
SQLite
Vladislav, 2021-12-08 15:15:01

Why does this line of code, instead of changing the value in the table, just add a new one?

c.execute("INSERT INTO bustbuy VALUES ({0}, 'Да', 'Нет', 'Нет','none')".format(message.chat.id))


It does not update, but simply creates a new row in the database.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-12-08
Likov @Laziff

Because the INSERT command adds a new record.
If you want to change an existing one - use UPDATE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question