Tkinter GUI application to add, display update and delete Blob column data with image of MySQL table

preview_player
Показать описание
Create MySQL table student_profile with sample data and images from the downloaded zip file. There are five different sections and five files are available.

Create the MySQL table and update each file with mysql database login details of your system.
Displaying records
You have to install PIL ( Python Image Library ) to manage image reading and display. The binary data or the image of each record is collected and displayed by using PIL.
Here student[2] is the data collected from Blob column of the record.

stream = io.BytesIO(student[2])
img = ImageTk.PhotoImage(img)

As we are displaying images inside a loop, we have to take care to refresh the image by using garbage collection. We will be adding the image to one array at the end of each loop.
Selecting record
We can select one name from one OptionMenu and on selection the full details of that record including the image from Blob column will be displayed.
Updating records
We can change the image associated with the record by using UPDATE query. While updating first we will display the record details by selecting the name of the student. The details with image will appear on the window, user can upload a new image by using clicking a button and by using update button user can replace the stored image with newly uploaded image.

Deleting record with image.
Inside the Tkinter GUI first we will display the record with the image, each image will have one delete button. This display part we will keep inside a function display(). On click of the delete button the record id will be passed to another function del_data().
Inside the del_data() function first we will collect the id and using delete query the record will be deleted. After deletion of the record all the widgets from the window will be removed. The display function display() is called again to take a fresh data and display the rows reflecting the new set of records.
Download the zip file from here and post your questions below.

#tkinterblob #managingblob #GUIBLOB #tkinter #BLOB #mysqlblob #mysqltkinter #managingblob
Рекомендации по теме
Комментарии
Автор

The greatest teacher, your lectures is very beneficial.

ab-jv
Автор

Sir i typed localhost/myphpadmin it doesn't work

porogonzales
Автор

Sir i cant open myphpadmin pls help how to access database

porogonzales