Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何解决错误';非类型';对象不可下标?_Sql_Python 3.x - Fatal编程技术网

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