Dec-13-2020, 07:42 PM
Hi there. I have been working on a library managment system. I am using MySQL as DB and Tkinter as GUI.
This error:
Please help
Thanks in advance
This error:
Error:File "C:\Program Files\Python38\lib\site-packages\mysql\connector\cursor_cext.py", line 232, in executeif not self._cnx:ReferenceError: weakly-referenced object no longer exists
is being returned by this chunk of code:def submit(): search_words = search_entr.get() search_type = variable.get() if search_type == "Pick A Search Type": messagebox.showerror("Invalid Choice", "'Pick A Search Type' is not a valid search type.") else: global results if search_type == "ISBN": cur.execute("SELECT * FROM Books WHERE ISBN = %s", (search_words)) results = cur.fetchball() if search_type == 'Title': cur.execute("SELECT * FROM Books where ITLE = %s", (search_words)) results = cur.fetchball() if search_type == "Author": cur.execute("SELECT * FROM Books WHERE AUTHOR = %s", (search_words)) results = cur.fetchball()I have looked high and low for a solution, but have found none.
Please help
Thanks in advance