Jul-29-2021, 05:07 AM
This query works great for me, try it with your query.
Try your select query directly in MySQL with a specific value for pc_name, like pc_name = 'Lenovo' .
You need to get mycmb before you call cur.execute with placeholders, you know that right? (Don't get mad, just checking!)
So, when you have a correct value in mycmb, yours would be:
cur = conn.cursor() # Select query cur.execute(f"SELECT studentnr, score FROM allstudentsAnswers{clas} WHERE weeknr = '{weeknr}'") output = cur.fetchall()Print your mycmb to make sure it is what it should be. Looks funny to me, but I have no experience using comboboxes
Try your select query directly in MySQL with a specific value for pc_name, like pc_name = 'Lenovo' .
You need to get mycmb before you call cur.execute with placeholders, you know that right? (Don't get mad, just checking!)
So, when you have a correct value in mycmb, yours would be:
cur = conn.cursor() # Select query cur.execute(f"SELECT * FROM tbl_colours WHERE pc_name = '{mycmb}'") output = cur.fetchall()