Jump to content

Best practice question in the event a user selects multiple itmes from a category lis


learningPHP1

Recommended Posts

Hello,

I wrote a small script that basically displays 20 to 30 categories on a page which a user has the option toeither select one or multiple items from the list. For the sack of argument the user selected the following items from the list:

Table-> tbl_category : ‘Green car’, ‘truck’, ‘Van’, ‘minivan’,’ laptop’, ‘iPhone’, ‘great value mixed nuts 80% peanuts’, ‘cup’

Tables I have:
Table-> tbl_user
Table-> tbl_category

What is the best practice in terms of saving the multiple selection:

1.Do I create a field in tbl_user and save the selection or selections into that one field?
2. Create a separate tbl_saveCategoreySelection and save them as individual records and link it to tbl_user? 


At the same time the saved category list will need to be searchable.

Any help you can provide would be greatly appreciated.
Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.