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 previous recipes in 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 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.

In order to ...

Get Python GUI Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.