I have a database consisting of 3 columns. I want to match just one item from one column.
Enter your name. bob
is this you? bob
1 Yes
2 No
What am I doing wrong?
def interface(): '''Create interface allowing team members to bid starting with highest seniority.''' # Enter name name = input('Enter your name. ') # confirm name and current bid conn = sqlite3.connect('Bid.db') cursor = conn.cursor() sql = 'SELECT Name FROM Bid WHERE Name=?' results = cursor.execute(sql, name) #bid_list = results.fetchall() print(results) confirm = input(f'Is this you?\n{bid_list}\n') options = ('1 Yes', '2 No') print('\n'.join(options))current output:
Enter your name. bob
Error:Traceback (most recent call last):
File "interface.py", line 35, in <module>
interface()
File "interface.py", line 18, in interface
results = cursor.execute(sql, name)
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 3 supplied.
desired output:Enter your name. bob
is this you? bob
1 Yes
2 No
What am I doing wrong?