Python 和 MySQL 中的学校项目代码

问题描述

调用了我的 inventory_check 函数(如下):

def inventory_check():
    t="""select * from stock"""
    c.execute(t)
    allrec=c.fetchall()
    for records in allrec:
        print("Batch_no: ",row[0])
        print("Med_Name: ",row[1])
        print("manufacturer: ",row[2])
        print("man_date: ",row[3])
        print("exp_date: ",row[4])
        print("Quantity: ",row[5])
        print("Sell: ",row[6])
        print("Balance: ",row[7])
        print("initial_cost: ",row[8])
    '''print(tabulate(allrec))
    print("\n")
    ans=input('')
    main()'''

我收到此错误

Traceback (most recent call last):
  File "C:\programs\python\python 37\xib1920\MEDICINE MANAGEMENT SYstem CODE.py",line 428,in <module>
    main_code()
  File "C:\programs\python\python 37\xib1920\MEDICINE MANAGEMENT SYstem CODE.py",line 236,in main_code
    inventory_check()
  File "C:\programs\python\python 37\xib1920\MEDICINE MANAGEMENT SYstem CODE.py",line 17,in inventory_check
    c.execute(t)
  File "C:\programs\python\python 37\lib\site-packages\MysqL\connector\cursor.py",line 521,in execute
    self._connection.handle_unread_result()
  File "C:\programs\python\python 37\lib\site-packages\MysqL\connector\connection.py",line 1059,in handle_unread_result
    raise errors.InternalError("Unread result found")
MysqL.connector.errors.InternalError: Unread result found

请让我知道我在这代码中做错了什么导致了这个错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)