Encode the values for the query, so values with blanks do not screw the program