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?
which database system is this? i've never heard of "datatype EM"
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.
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
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...