Welcome Guest, Not a member yet? Register   Sign In
Best way to store "choose all that apply" type questions.
#4

[eluser]WanWizard[/eluser]
@mddd, very good point.

As said, using a bit pattern is only possible if the order of the options is not going to change. You can add extra options at the end of the list as long as you have bits left, but reordering them is going to give you a headache. Smile

A search is possible on the imploded variant, but quite complex, you'll get queries like
Code:
// from an old chunk of ExiteCMS v7 code:
$result = dbquery("SELECT group_id, group_name FROM ".$db_prefix."user_groups WHERE group_groups REGEXP('^\\\.{$group_id}$|\\\.{$group_id}\\\.|\\\.{$group_id}$')");

which works, but might be quite slow as you won't be able to use indexes. Also, it's not portable.


Messages In This Thread
Best way to store "choose all that apply" type questions. - by El Forum - 07-28-2010, 03:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB