[thelist] Basic SQL question

Bob Haroche spambait at onpointsolutions.com
Sat Jan 3 10:18:58 CST 2004


> But how are you storing them? As
> +----------+--------------+
> | MemberID | MemberColors |
> +----------+--------------+
> |        1 | red          |
> |        1 | blue         |
> |        2 | yellow       |
> |        2 | silver       |
> +----------+--------------+


Yes, storing them like that. Basically using a linking MembersColors linking
table btwn Members and Colors table.

The submission form uses several checkboxes all with the name "color" so
that when a user checks three boxes, Cold Fusion returns the value of the
color checkbox as "color1, color2, color3".

That's fine if I want to use IN in the SQL statement to choose members who
are associated with ANY of those colors, but I need to choose members who
are associated with ALL those colors.

The tricky part (for me) is that the number of returned colors varies
depending on how many checkboxes were selected.

-------------
Regards,
Bob Haroche
O n P o i n t  S o l u t i o n s
www.OnPointSolutions.com



More information about the thelist mailing list