I'm working on a project for computer science, where I have to make a database program using SQLite3 with GUI (so I use tkinter)
Now I want to change the value of an item in a table with a WHERE statement, but this doesn't work. This is my code (I already connected with the database).
def show():
Name = tk.Label(self, text="Name")
Name.grid(row=2, column=0)
NameA = tk.Entry(self)
NameA.grid(row=2, column=1)
var1 = tk.IntVar()
vijfprA = tk.Checkbutton(self, text="Vijf procent", variable=var1)
vijfprA.grid(row=4, column=1)
def veranderen():
if var1.get() == 1:
koe = NameA.get()
c.execute('''UPDATE reserveringen SET deelbetaald = "Yes" WHERE
naamgezelschap = (?)''', (koe))
conn.commit()
button2 = tk.Button(self, text="Invoegen", command=veranderen)
button2.grid(row=5, column=1)
This is only the part where the error starts. This is the error I get:
> sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied.
Thanks!!
koeis, it has 8 values, but your SQL only allows for 1. Which of those values do you want to use?