|
Posted by J.O. Aho on 02/05/06 01:54
Jim S. wrote:
> hey guys and gals,
> here is my problem:
> i have a form, and recently my crazy mind decided to make 5 select/menus
> that belong to the same field ("features"),(each select/menu has many
> options, that is why i chose the select menu not, an another way)
>
> SO: the options for "features" field are let us say: (menu value)
>
> smart 1, happy 2, crasy 3 , depressed 4, frustrated 5, lazy 6, dumb 7
>
> now, the user has to choose 4 from them,
>
> So: i made 5 select/menus to select from (each one at a time)
>
> so far so good, if u are still reading, am impressed and i really thank you
> :)
>
Why not make it simple to make one multiselect list
<SELECT MULTIPLE SIZE=5 NAME="features[]">
<OPTION VALUE="o1">Option 1
<OPTION VALUE="o2">Option 2
<OPTION VALUE="o3">Option 3
<OPTION VALUE="o4">Option 4
<OPTION VALUE="o5">Option 5
<OPTION VALUE="o6">Option 6
</SELECT>
> i succeeded to have the value ( for my example) 0,0,0,0,5,0,0
> now i want to get the value of $all in the database, (so i can spit it out
> later with an "echo" or something)
> i made a field in the database with ENUM, with the "list" inserted in it
> sequetially
Say your list gets longer and you have 15 to select from, and you want to look
for say five (5), you will get more trouble with your search query as the five
could be the first, last or somewhere in the middle, you need to think about
the commas as you can search fro just '%5%' as this would return the users who
has selected 15.
This makes it a lot more difficult to search IMHO, I would rather have a table
where I save the userid and the value where the userid+value is the key (to
prevent multiples of the same result in the table).
//Aho
[Back to original message]
|