I was wondering if I allowed my users to pick which categories their post will be displayed in and they can pick multiple categories from one to many.
- How would I store the categories id value or values in the database?
- Should I group each value together for example, 45,12,45,78 or should I store one value at a time?
- And how would my table structure look like?
- Or should I add it to an existing table?
The structure you are describing is really a many-to-many relationship (used in all tag-structures and alike).
A typical SQL call to check on ALL entries from a tag would be
A typical SQL call to check on tags from an entry would be