Apr-04-2021, 03:00 AM
Code below does not work ? The mycursor.callproc("getclockinhoursbyweek",()) is the problem.
The difference in code above is that I am using stored procedure. "getclockinhoursbyweek"
mydb = mysqldb.connect(host="localhost", user="xxxxx",password="xxxx", db="xxx", use_unicode=True,charset="utf8")
mycursor = mydb.cursor()
mycursor.callproc("getclockinhoursbyweek",())
myresult = mycursor.fetchall()I have working code below and it returns data. The difference in code above is that I am using stored procedure. "getclockinhoursbyweek"
mydb = mysqldb.connect(host="xxxxxx", user="xxxxxx",password="xxxxx", db="xxxxxxx", use_unicode=True,charset="utf8")
mycursor = mydb.cursor()
mycursor.execute("SELECT userid, username, userpassword FROM user")
myresult = mycursor.fetchall()
