0% found this document useful (0 votes)
1 views1 page

Online Python Compiler (Interpreter)

The document contains a Python function designed to delete a record from a MySQL database. It connects to a local database named 'bloodbank', retrieves the row ID to be deleted, executes the delete command, and confirms the deletion with a message box. The function also closes the associated window after the operation is completed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views1 page

Online Python Compiler (Interpreter)

The document contains a Python function designed to delete a record from a MySQL database. It connects to a local database named 'bloodbank', retrieves the row ID to be deleted, executes the delete command, and confirms the deletion with a message box. The function also closes the associated window after the operation is completed.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python

Python Online Certification ›


Compiler

main.py Save Run Shell Clear

1 def delete_record_func(): >


2 entered_rowid = delete_record_entry.get()
3 conn = mysql.connector.connect(host = "localhost",
password = 'Saraswathi',user= 'root',database =
'bloodbank')
4 c = conn.cursor()
5 c.execute("DELETE FROM donar_table WHERE rowid = ?"
,entered_rowid)
6 conn.commit()
7 adminlogin_window_data.destroy()
8 response6 = messagebox.showinfo("DELETED","RECORD
DELETED")

You might also like