lostinfourth Posted August 27, 2011 Share Posted August 27, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/245827-checkbox-form-selects-from-mysql-table-column-with-datatype-em/ Share on other sites More sharing options...
cunoodle2 Posted August 27, 2011 Share Posted August 27, 2011 why do you need multiple data types? Are they predefined fruit baskets? Or can people build their own custom baskets? Can you just use SELECT field FROM table where fruit LIKE '%appple%'; ?? Quote Link to comment https://forums.phpfreaks.com/topic/245827-checkbox-form-selects-from-mysql-table-column-with-datatype-em/#findComment-1262651 Share on other sites More sharing options...
lostinfourth Posted August 28, 2011 Author Share Posted August 28, 2011 Hi, thanks for your reply. When I enter a row in my database, one of the columns is called "FruitsinBasket" -- I have different types of baskets and I select the fruits in that particular basket. The column is a datatype EM, so I can select multiple fruits for each basket. I'd like the customer to be able to search for those baskets containing certain fruits, from a page with a list of available fruits (checkboxes) and return a list of the baskets that match their selection of fruits. Is this possible? Or should I have one column for each fruit or a different table entirely for the fruits? Thanks, I'm very new to all this. Quote Link to comment https://forums.phpfreaks.com/topic/245827-checkbox-form-selects-from-mysql-table-column-with-datatype-em/#findComment-1262820 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.