O'Reilly logo

Python GUI Programming Cookbook by Burkhard A. Meier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the SQL UPDATE command

This recipe will use the code from the previous recipe, explain it in more detail, and then extend the code to update our data.

In order to update data we have previously inserted into our MySQL database tables, we use the SQL UPDATE command.

Getting ready

This recipe builds on the previous recipe, so read and study the previous recipe in order to follow the coding in this recipe where we modify existing data.

How to do it…

First, we will display the data to be modified by running the following Python to MySQL command:

import mysql.connector as mysql import GuiDBConfig as guiConf class MySQL(): # class variable GUIDB = 'GuiDB' #------------------------------------------------------ def showData(self): # connect to MySQL ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required