I am facing error of output not showing the correct bookid ,which i am picking instead it picks starting one and later when i am using it again it shows all data any idea what to do on this plss telll and i have also bolded some errors in output
import mysql.connector
#mydb=mysql.connector.connect(host='localhost',user='root',passwd='123456789')
mycursor=mydb.cursor()
mycursor.execute("USE booklibrary")
question=input("Do you want to display any record??(y/n):")
if question=='y':
while question=="y":
print("Do you have information about the record??")
print("1-bookid")
print("2-bookname")
print("3-bookholdername")
print("4-library id")
print("5-Exit")
choice=int(input("enter your choice:"))
print(mycursor.fetchall())
if choice==1:
bookID=input("enter the bookid:")
mycursor.execute("SELECT * FROM booklist WHERE bookid=bookID")
data1=mycursor.fetchone()
print(data1)
elif choice==2:
bookName=input("enter the bookname:")
mycursor.execute("SELECT * FROM booklist where bookname=bookName")
data2=mycursor.fetchone()
print(data2)
elif choice==3:
bookHolderName=input("enter the bookholdername:")
mycursor.execute("select * from booklist where bookholdername=bookHolderName")
data3=mycursor.fetchone()
print(data3)
elif choice==4:
library=input("enter the library id:")
mycursor.execute("select * from booklist where LibraryID=libraryid")
data4=mycursor.fetchone()
print(data4)
elif choice==5:
break
else:
print("invalid choice")
else: print("no record displayed")
#OUTPUT Do you want to display any record??(y/n):y
Do you have information about the record??
1-bookid
2-bookname
3-bookholdername
4-library id
5-Exit
enter your choice:1
[]
enter the bookid:2
(1, ' Rd sharma', datetime.date(2022, 3, 18), datetime.date(2022, 4, 1), 'Ramesh', 'xuv1')
Do you have information about the record??
1-bookid
2-bookname
3-bookholdername
4-library id
5-Exit
enter your choice:1
[(2, 'Sumita arrora', datetime.date(2022, 4, 20), datetime.date(2022, 5, 4), 'suresh', 'xuv2'), (3, 'sadf', datetime.date(2022, 4, 1), datetime.date(2022, 4, 3), 'nasd', 'ads1'), (4, 'safw', datetime.date(2022, 4, 4), datetime.date(2022, 4, 7), 'afse', 'scw1'), (5, 'saf', datetime.date(2022, 4, 1), datetime.date(2022, 4, 11), 'dhd', 'wer3'), (6, 'asfasf', datetime.date(2020, 1, 1), datetime.date(2020, 1, 14), 'asfq', 'xvr3'), (7, 'aasd', datetime.date(2020, 4, 4), datetime.date(2020, 4, 7), 'asdqr', 'fddx1'), (8, 'asfa', datetime.date(2022, 7, 10), datetime.date(2022, 7, 15), 'asdsax', 'za1w'), (9, 'agd', datetime.date(2022, 7, 11), datetime.date(2022, 7, 15), 'asfxvs', 'asd2')]