Python 无法将TKInter值添加到MySQL表
我正在尝试使用python查询将记录添加到Mysql表中。为了添加记录,我使用tkinter和tkinter“ENRTY”函数制作了一个GUI 这是密码Python 无法将TKInter值添加到MySQL表,python,mysql,sql,tkinter,Python,Mysql,Sql,Tkinter,我正在尝试使用python查询将记录添加到Mysql表中。为了添加记录,我使用tkinter和tkinter“ENRTY”函数制作了一个GUI 这是密码 mydb=msc.connect(host="localhost",user="VAIBHAV",password="123456",database="homework") mycursor=mydb.cursor()
mydb=msc.connect(host="localhost",user="VAIBHAV",password="123456",database="homework")
mycursor=mydb.cursor()
mycursor.execute("insert into RECORDS values(%s,%s,%s,%s,%s,%s,%s,%s)",(adm_I,name_I,Class_I,fh_I,mh_I,adress_I,phone_no_I,email_id_I))
print("Records added")
mycursor.commit()
mycursor.close()
但是我运行程序并执行Python函数,我得到以下错误:
我不知道出了什么问题应该是
mydb.commit()
嘿,你为什么大喊大叫??请不要呼喊大写的句子被认为是呼喊,你需要存储TKInter条目的值,而不是条目本身。请不要发布代码或错误的图片。图像无法搜索,视力受损者根本无法阅读。我们可以尝试使用adm_I.get()
并对其他小部件执行相同操作,确保发布更多的条目小部件创建代码