Hi so Im trying to update my table, in which the user can select the column and row he wants to update though variables. Here what i have done so far but im not really sure how to go about this any help would be great thanks.
Max_marks=int(self.MDMax_inp.text()) #take input from maximim marks entry
Marks_scored= int(self.MDAch_inp.text()) #take input from maximim marks entry
Percentage_scored = (Max_marks/Marks_scored)*100 #formula to find percentage
Current_student = (self.MGStudent_drop.currentText()) #take data held in student name drop down
Current_topic= (self.MGMarks_drop.currentText()) #take data held in topic drop down
con = lite.connect('Student_names')#Links code to the data base file
cur = con.cursor()
cur.execute("UPDATE gradesdb SET {cn}=(?) WHERE {idf}=(?)"(Percentage_scored,Current_student).\
format( cn=Current_topic, idf=Names))
con.commit()
Aucun commentaire:
Enregistrer un commentaire