Answer the question
In order to leave comments, you need to log in
How to change value in SQLite?
nickname = input('Введите ник: ')
user_login = int(1) #1 для примера
sql.execute(f'UPDATE users SET nick = {nickname} WHERE login = "{user_login}"')
db.commit()
Answer the question
In order to leave comments, you need to log in
Single quotes must be used. And here nick = {nickname}
, and here login = "{user_login}"
But better, as said above:
sql.execute(f'UPDATE users SET nick = ? WHERE login = ?', (nickname, user_login))
Using string interpolation to generate sql query is a very bad idea.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question