python - 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server -
i'm having trouble python odbc code. don't following code work: temp=process_query("select fname, lname employee ssn='%s'" %i) known_hours=process_query("select distinct coalesce(hours,0) works_on essn='%s'" %i) temp.append(known_hours) where process_query takes form: def process_query(query): cursor1.execute(str(query)) (process_query continues more merely printing surposes, when i've searched web problem seems problem lies within how call execute function omitted rest of function here). the error receive when i'm trying execute program is: pyodbc.programmingerror: ('42000', "[42000] [mysql][odbc 5.1 driver][mysqld-5.1.66-0+squeeze1-log]you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'john', [decimal('32.5'), decimal('7.5')], 'yes']'' @ line 1 (1064) (sqlexecdirectw)") would grateful if me out! ps. i