[RESOLVED] Best Practice: Multiselect List
Using php/mysql.
I have a form to submit info to a table.
On the form I have a multiselect list box. Is it better to store a comma delimited string to one single field in the table once the form is submitted, or should I create a join table that has a separate row for each selected object in the list box?
What's the better option?
I am thinking I should create a join table, since each list item is linked to a table called "options".
Re: Best Practice: Multiselect List
Re: Best Practice: Multiselect List
You're thinking is exactly right:thumb:
A comma separated list will work but it's going to give you a million and one problems down the line. Databases are designed to work by rows in tables and that's going to be the best solution for you at every step of the way. If you want some background as to why then read up on "normalisation".
Re: Best Practice: Multiselect List