"Record" is a key word in Python referring to a tuple list... "x" doesn't appear to be defined. So the For Loop should read: For record in results:
Then retrieve the "values" for each record