0

here is my code

        def delete():
            con = sqlite3.connect("Cadets2.db")
            cr = con.cursor()
            selectedItem = self.cadet_table.selection()[0]
            self.cadet_table.delete(selectedItem)
            cr.execute("DELETE FROM cadets WHERE phone_number=?" , ( selectedItem, ))
            con.commit()
            con.close()

when i click to the command to delete the element from treeview , nothing happend on debug and the student deleted from tree view but still on Database.

i tried to check if i save the changes happend on db but i see the con.commit() i think it's enough to let Database saved what i do.

Aperion9
  • 1
  • 1

0 Answers0