Good morning drupal.org !

I have a form into which a user can enter parameters, which are then used to retreive a list of matching profiles. I am currently getting a list of strings from the form, eg, 'favourite colour' is a set of checkboxes and the returned array contains: ('red'=>0, 'blue'=>'blue', 'green'=>'green'), where red was not selected and blue/green were.

Because the values are serialized into the database, the SQL statement will include a string like this (this is very pseudo-sql but the idea is the same):

WHERE profile_colour in ('s:3:"red"', 's:5:"green"')

This feels very clunky and badly done, but I can't think of a better way, and drupal doesn't support the kind of user-search granularity I need.

Can anyone help me with a suggestion? Is this the way you would do it??