Gentlemen, can you help me? I have a piece of code. There are two text fields 1 (tpn) 2 (name) in the script. In the mysql database I also have two tpn columns and a name. I would like to insert the contents of the searched value from the database in texbox2 after entering into textbox1 from the column name for the searched value. Will you help me ??
from tkinter import * import pymysql window=Tk() window.title("Python") menu = Menu(window) conn= pymysql.connect(host='106.90.5.2',user='admin',password='admin123',db='Base') a= conn.cursor () sql = 'select nazwa from karta_artykulu;' countrow = a.execute(sql) #print("Number od rows :",countrow) data = a.fetchall() print (data) #----------------------------------------------------------------------------Wprowadzanie textbox do nazw author_text=StringVar() al=Entry(window,textvariable=author_text,width=40,font=('CALIBRI', 12)) al.grid(row=2,column=1) #----------------------------------------------------------------------------textbox art author_text=StringVar() t1=Entry(window,textvariable=author_text,width=20,font=('CALIBRI', 12)) t1.grid(row=2,column=2) #buttons b1=Button(window,text="PRINT",width=18,fg="red",font=('CALIBRI', 14, 'bold')) b1.grid(row=15,column=7) window.mainloop()