I am attempting to execute the following query via the mysqldb module in python:
for i in self.p.parameter_type: cursor.execute("""UPDATE parameters SET %s = %s WHERE parameter_set_name = %s""" % (i, float(getattr(self.p, i)), self.list_box_parameter.GetStringSelection()))
I keep getting the error: "Unknown column 'M1' in 'where clause'". I want to update columns i with the value getattr(self.p, i), but only in rows that have the column parameter_set_name equal to self.list_box_parameter.GetStringSelection(). The error suggests that my query is looking for columns by the name 'M1' in the WHERE clause. Why is the above query incorrect and how can I correct it?