def CustomerTableAdd():
CTA = Toplevel(root)
Label(CTA, text = "Title: ").grid(row = 0, column = 0)
TEbox = Entry(CTA, width = 25).grid(row = 0, column = 1)
Label(CTA, text = "First Name: ").grid(row = 1, column = 0)
FNEbox = Entry(CTA, width = 25).grid(row = 1, column = 1)
Label(CTA, text = "Last Name: ").grid(row = 2, column = 0)
LNEbox = Entry(CTA, width = 25).grid(row = 2, column = 1)
Label(CTA, text = "House Number: ").grid(row = 3, column = 0)
HNEbox = Entry(CTA, width = 25).grid(row = 3, column = 1)
Label(CTA, text = "Street Name: ").grid(row = 4, column = 0)
SNEbox = Entry(CTA, width = 25).grid(row = 4, column = 1)
Label(CTA, text = "Post Code: ").grid(row = 5, column = 0)
PCEbox = Entry(CTA, width = 25).grid(row = 5, column = 1)
Label(CTA, text = "City: ").grid(row = 6, column = 0)
CEbox = Entry(CTA, width = 25).grid(row = 6, column = 1)
Label(CTA, text = "Phone Number: ").grid(row = 7, column = 0)
PNEbox = Entry(CTA, width = 25).grid(row = 7, column = 1)
Label(CTA, text = "Customer ID: ").grid(row = 8, column = 0)
CIEbox = Entry(CTA, width = 25).grid(row = 8, column = 1)
CTAsave = Button(CTA, text = "Save", command =CustomerTableAddSave).grid(row = 9, columnspan = 2)
Okay so basically I have those entry boxes and I want to use the information given inside those boxes and save it onto a database, I've been trying out looking out for answers in other topics but nothing seems to work, I didnt use classes because I dont really know how to and this is for my project so I need to know ASAP. I keep on getting errors that TEbox is not defined etc... I dont know whats happening could someone explain how to use the information and put it onto a database using SQLite? Tried using the .get command but it didnt seem to work either.
Aucun commentaire:
Enregistrer un commentaire