I am trying to create a re-usable mysql statement for updating from a dictionary where the keys are the database fields and the data to go into that field is the value assoc
how about trying
stmt = "UPDATE TABLE table_name SET " for k,v in di.items(): stmt += "%s = %s, " %(k,v) stmt = stmt[-2:]