I
I
Ivan2020-07-13 21:20:46
Python
Ivan, 2020-07-13 21:20:46

Cause of the error while inserting a line?

made a function for quick insert

c.execute(f'INSERT INTO westusers VALUES(id = {ida}, name = {namea}, username = {usernamea}, mail = {maila}, status = {statusa}, main = {maina}, uunique = {uuniquea}, donatebalance = {donatebalancea})')

I use it
westadduser(ida = message.from_user.id, namea = message.from_user.username, usernamea = message.from_user.username)

It gives an error that all the columns I entered do not exist.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2020-07-14
@mlneko

The problem turned out to be completely different, in the function when inserting, it was necessary to put brackets on the emphasis on " {ida} "
...westusers VALUES(id = "{ida}"....

K
kirillinyakin, 2020-07-13
@kirillinyakin

Is it possible to write this way in SQL, more correctly

INSERT INTO westusers(id ,name , username, mail, status, main, uunique, donatebalance) VALUES( Здесь пишешь свои значения)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question