Storing and retrieving data from our MySQL database
We will use our Python GUI to insert data into our MySQL database tables. We have already refactored the GUI we built in the previous recipes in our preparation for connecting and using a database.
We will use two textbox entry widgets into which we can type the book or journal title and the page number. We will also use a ScrolledText
widget to type our favorite book quotations into, which we will then store in our MySQL database.
Getting ready
This recipe will build on the MySQL database and tables we created in the previous recipes.
How to do it…
We will insert, retrieve, and modify our favorite quotations using our Python GUI. We have refactored the MySQL tab of our GUI in preparation for this:
GUI_MySQL.py
In order to make the buttons do something, we will connect them to callback functions as we did in the previous recipes. We will display the data in the ScrolledText
widget below the buttons.
In order to do this, we will import the MySQL...