Sql 如何解决错误';非类型';对象不可下标?
错误是这样的 “非类型”对象不可下标Sql 如何解决错误';非类型';对象不可下标?,sql,python-3.x,Sql,Python 3.x,错误是这样的 “非类型”对象不可下标 如果我不得不猜一猜来救我的命,我会猜当你用你的: conn = mysql.connector.connect(host="localhost",user="root",password="",db="mja_database") myCursor = conn.cursor() myCursor.execute("SELECT * FROM mja_attendance WHERE emp_num='%s'"%emp_numtb.g
如果我不得不猜一猜来救我的命,我会猜当你用你的:
conn = mysql.connector.connect(host="localhost",user="root",password="",db="mja_database")
myCursor = conn.cursor()
myCursor.execute("SELECT * FROM mja_attendance WHERE emp_num='%s'"%emp_numtb.get())
res=myCursor.fetchone()
if res[1] == None and res[3] == None:
messagebox.showinfo("Notification", "No data in yet.")
也许放进去
if res[1]...
如果您需要更多帮助,您应该在问题中添加更多详细信息。它是否提供了NoneType来自何处的行号?
res=myCursor.fetchone()
if not res:
messagebox.showinfo("Notification", "Res is None")
elif res[1] == None and res[3] == None:
messagebox.showinfo("Notification", "No data in yet.")
def resul(g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12,g13,g14):
run=enter(g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12,g13,g14)
d=run.Tmoy
messagebox.showinfo(title="Resultat", message='NUT = {}\n E={} \nT1s ={} C°'.format( d[0], d[1], d[2]))
messagebox.showinfo(title="Resultat", message='NUT = {}\n E={} \nT1s ={} C°'.format( d[0], d[1], d[2]))
TypeError: 'method' object is not subscriptable