multiple items in same field; how to dispay them on page?
Hello,
I have a database containing a field (categories) that contains multiple values (category ids) comma separated (i.e.: 1,3,4,5,7,9,13,,,)
As an example, imagine a table similar to this:
name - category
name1 - 1,2,3,6,7
name2 - 4,5,6,7
name3 - 7,8
and so on...
Consider another table containing all categories:
cat_id (id) - cat_name (name of category)
1 - category 1
2 - category 2
3 - category 3
4 - category 4
5 - category 5
6 - category 6
7 - category 7
...
How can I display the catogories in dreamweaver?
I would like to display them as:
name1
category 1 | category 2 | category 3 | category 6 | category 7
name2
category 4 | category 5 | category 6 | category 7 |
name3
category 7 | category 8 |
I would create two recordsets: one that gets the correct record and one that gets all categories.
Then I would explode the cat_id field and loop the values linking them to the rs_category fields.
Would this work?
Or what is the best method to handle this scenario?
TIA
tony