Skip to main content

Posts

Showing posts from November, 2018

Inserting,Deleting and Updating table values in Database using Python Programming

Insert,Delete and Update import tkinter as tk from tkinter import * import mysql.connector import datetime def IsValidDate(InputDate):     day = InputDate[:2]     month = InputDate[3:5]     year = InputDate[6:]         IsValid = True         try :         datetime.datetime(int(year),int(month),int(day))     except ValueError :         IsValid = False     return IsValid def FormatDBDate(InputDate):     dt = InputDate[6:] + "-" + InputDate[3:5] + "-" + InputDate[:2]     return dt    def FormatEDDate(InputDate):     dt =  InputDate[8:] + "/" + InputDate[5:7] + "/" + InputDate[:4]     return dt  def DeleteEmployee(id, eid, ename, dob, doj, adr, cty, pcd, mob, eml, gen, dep):     conn=mysql.connector.connect(user='root',password='harsha',host='localhost', database='office')     cur=conn.cursor()         try:         result = tk.messagebox.askquestion("Delete", "Are Y