Incorrect number of bindings supplied. The current statement uses 1, and there are 3 supplied.
#You need to pass in a sequence, comma at the end:
cursor.execute('SELECT * FROM TABLE WHERE COL = ?;', (string,))
Incorrect number of bindings supplied. The current statement uses 1, and there are 3 supplied.
#You need to pass in a sequence, comma at the end:
cursor.execute('SELECT * FROM TABLE WHERE COL = ?;', (string,))
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 7 supplied.
#Whats happening is that instead of getting the 1 datatype its looking for,
#SQLite thinks its getting multiple. To solve this pass the data through as a
#tuple, not on its own
cursor.execute('INSERT INTO images VALUES(?)', (data)) #should be
cursor.execute('INSERT INTO images VALUES(?)', (data,))
#To demonstrate, print the lengths of both of the options:
len(data)
>>>7
len(data,)
>>>1
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us