在密码管理器中编辑密码
好吧,我正在尝试在我的密码管理器应用程序中编辑密码。这就是函数;
def edit_password(password):
text3 = 'Password'
password = pop_up(text3)
insert_fields = ('UPDATE vault SET password = ?')
cursor.execute(insert_fields, (password))
db.commit()
password_vault()
我使用像这样的按钮来调用它;
btn = Button(window, text='Edit', command=partial(edit_password, array[i][0]))
btn.grid(column=5, row=i+3, pady = 30, padx=30)
但是,它正在更改整个密码列。
okay so I am trying to edit passwords in my password manager app. this is the function;
def edit_password(password):
text3 = 'Password'
password = pop_up(text3)
insert_fields = ('UPDATE vault SET password = ?')
cursor.execute(insert_fields, (password))
db.commit()
password_vault()
I call it using a button like so;
btn = Button(window, text='Edit', command=partial(edit_password, array[i][0]))
btn.grid(column=5, row=i+3, pady = 30, padx=30)
However, it is changing the entire password column.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不带 WHERE 子句的 UPDATE 语句将更新表中的所有记录。
因此,您需要类似的内容:
假设
username
是vault
表的唯一列。请注意,不建议存储纯文本密码。
UPDATE statement without a WHERE clause will update all records in the table.
So you need something like:
assume
username
is the unique column ofvault
table.Note that storing plain text password is not recommended.