Sep-11-2021, 10:18 PM
Thanks for the tips!
print(f"sql: {sql}") gives:
This, for example, works fine:
I made a query for all the columns I want:
sql = 'SELECT studentnr, Answer1, Answer2, Answer3, ...... , Answer61 FROM allstudentsAnswers20BECW WHERE weeknr = \'Week1\''
but that fails with the same error. Something weird in there!
Doesn't matter, I just exported the whole table from MySQL as .csv and got what I needed from there!
A mystery!
print(f"sql: {sql}") gives:
Quote:sql: SELECT * FROM allstudentsAnswers20BECW WHERE weeknr = %s
This, for example, works fine:
Quote:sql = f"SELECT studentnr, score, Answer1, Answer2 FROM allstudentsAnswers{clas}CW WHERE weeknr = %s"
I made a query for all the columns I want:
sql = 'SELECT studentnr, Answer1, Answer2, Answer3, ...... , Answer61 FROM allstudentsAnswers20BECW WHERE weeknr = \'Week1\''
but that fails with the same error. Something weird in there!
Doesn't matter, I just exported the whole table from MySQL as .csv and got what I needed from there!
A mystery!