gpt4 book ai didi

python-3.x - sqlite3 错误 : You did not supply a value for binding 1

转载 作者:行者123 更新时间:2023-12-03 19:12:01 26 4
gpt4 key购买 nike

def save():
global editor
conn = sqlite3.connect('address_book.db')

c = conn.cursor()

recordID = delete_box.get()

c.execute("""UPDATE addresses SET
first_name=:first,
last_name=:last,
address=:address,
city=:city,
state=:state,
zipcode=:zipcode

WHERE oid=:oid""",
{
'oid': int(recordID),
'first:': ef_name.get(),
'last': el_name.get(),
'address': eaddress.get(),
'city': ecity.get(),
'state': estate.get(),
'zipcode': ezipcode.get()})

conn.commit()
conn.close()
editor.destroy()

File "C:/Users/Luke/PycharmProjects/GUI/database.py", line 23, in save c.execute("""UPDATE addresses SET sqlite3.ProgrammingError: You did not supply a value for binding 1.



任何人都可以看到是什么导致了这个错误?我确定我没有在任何地方打错字,并且很困惑这可能是什么根源。

最佳答案

错误是由于额外的冒号造成的。代替

'first:': ef_name.get(), 
'first': ef_name.get(),

关于python-3.x - sqlite3 错误 : You did not supply a value for binding 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61788055/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com