lostinfourth — 2011-08-28T07:19:23-04:00 — #1
I have a database with a column of datatype EM (multiple selection, say apples, oranges, grapes)
I want to have a form with checkboxes for those values (apples, oranges, grapes etc) so one can select a breakfast basket type that contains for example, oranges and grapes.
It would pull from the database those baskets with those selection of fruits (specified in the column 'Fruits', which is a EM datatype column. (I have a multiple selection when entering the values for the column.)
Can it be done? Should I make another table with FruitNames?
r937 — 2011-08-28T08:15:39-04:00 — #2
which database system is this? i've never heard of "datatype EM"
lostinfourth — 2011-08-29T01:40:00-04:00 — #3
Sorry, I meant SET, MySQL column datatype.
I have multiple values in the column. When entering a new row, I can choose multiple values for the column FruitsinBasket.
Also, when I add a new fruit value to that column (so it can be selected from the dropdown list of multiple selection), all my other entries values disappear and I have to re-enter everything again.
Thank in advance.
r937 — 2011-08-29T02:49:49-04:00 — #4
my advice is to stay away from SET (and also ENUM)
you should really have a separate one-to-many table, which allows one row per fruit per basket
lostinfourth — 2011-08-29T03:24:55-04:00 — #5
which allows one row per fruit per basket
The query from the customer's fruit selection page (checkboxes) would be similar, I suppose?
Thanks for your advice, I'm reading more posts similar to mine and trying to figure this out...