Feb-10-2023, 03:19 PM
(This post was last modified: Feb-10-2023, 06:29 PM by Larz60+.
Edit Reason: fixed code tags
)
My code:
(I want "pathology" table in MySQL Workbench to be updated when clicking on the "update" button.)
![[Image: 272befc6c8601453b6913ad067dd5f95.png]](https://i.gyazo.com/272befc6c8601453b6913ad067dd5f95.png)
"Successfully updated"
![[Image: b21d61d49c0ba6492f1fa793a88a3130.png]](https://i.gyazo.com/b21d61d49c0ba6492f1fa793a88a3130.png)
Here's my "pathology" in MySQL Workbench. The values in the "pathology" table aren't updated.
(I want "pathology" table in MySQL Workbench to be updated when clicking on the "update" button.)
def update(self): conn=mysql.connector.connect(host="localhost",user="root",password="root",database="pathology") my_cursor=conn.cursor() my_cursor.execute("update pathology set receivedate=%s,patientname=%s,pathologynum=%s,gender=%s,age=%s,inspechospital=%s,casenum=%s,specimenclass=%s,bed=%s,diagnosis=%s,clinicaldiagnose=%s,inspecdoctor=%s,pathologydoctor=%s,sampledate=%s,reportdate=%s where num=%s",( self.var_rec_date.get(), self.var_patient_name.get(), self.var_path_num.get(), self.var_gender.get(), self.var_age.get(), self.var_sub_hospital.get(), self.var_case_num.get(), self.var_specimen_level.get(), self.var_bed.get(), self.var_diagnosis.get(), str(contents), self.var_submit_doctor.get(), self.var_simple_date.get(), self.var_path_doc.get(), self.var_report_date.get(), self.var_sys_num.get(), ))My "pathology report", you can see the "update" button.
![[Image: 272befc6c8601453b6913ad067dd5f95.png]](https://i.gyazo.com/272befc6c8601453b6913ad067dd5f95.png)
"Successfully updated"
![[Image: b21d61d49c0ba6492f1fa793a88a3130.png]](https://i.gyazo.com/b21d61d49c0ba6492f1fa793a88a3130.png)
Here's my "pathology" in MySQL Workbench. The values in the "pathology" table aren't updated.
![[Image: 89ad25108ef9a2e4755d3a3096b707c2.png]](https://i.gyazo.com/89ad25108ef9a2e4755d3a3096b707c2.png)