Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
839 views
in Technique[技术] by (71.8m points)

python - sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 18 supplied

I'm making a discord bot, and i need to check if exists a database where the name its the user discord id, but when i pass the id, even as a string, it returns me this error.

this is my code:

if message.content == '_registrar':

        print('           ',str(message.author.id))
        c.execute("SELECT count(name) FROM sqlite_master WHERE type='table' AND name=? ",'764997829734825996')
        if c.fetchone()[0] == 1:
            await message.channel.send('{}, Você já está registrado!!!'.format(message.author.mention))
        else:
            print('Table does not exist.')
            philia_welcome =

Obs: the text inside send it's in portuguese, it means: 'you're already registered', i'm saying this just to avoid confusion

question from:https://stackoverflow.com/questions/65927743/sqlite3-programmingerror-incorrect-number-of-bindings-supplied-the-current-sta

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...