O
O
Oleg Pariyev2020-01-06 17:09:21
Python
Oleg Pariyev, 2020-01-06 17:09:21

Why writes that one binding from 7 is executed?

Good afternoon!
There is a python 3.8.1 program with Tkinter GUI. When a certain button is pressed, the following function is executed:

fio = self.en_fio.get()
    clas = self.en_class.get()
    lit = self.en_lit.get()
    phone = self.en_phone.get()
    adr = self.en_adr.get()
    aut = self.en_aut.get()
    book = self.en_book.get()
    con_cur = conn.cursor()
    line = [(fio,clas,lit,phone,adr,aut,book)]
    con_cur.execute('INSERT INTO STUD VALUES (?,?,?,?,?,?,?)',line)

In this function, the data is taken from the input fields and assigned to the variables, and then each variable is entered into the table (STUD) in the corresponding column (they are named like the variables and go in the same order). But for some reason it throws an error:
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 7, and there are 1 supplied.

Please tell me how to fix this error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Yakushenko, 2020-01-06
@DgDays

line = [fio,clas,lit,phone,adr,aut,book]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question