Question
Grouping List Values from Different Database Columns
Hi Folks,
I've hit a bit of a stumbling block on how best to achieve this.
I'm trying to output a list of categories for different products, however each field may contain a number of values, comma-separated. For example;
Row 1: category1,category2,category3
Row 2: category1, category4
Row 3: category5
The output I'm aiming for is;
category1
category2
category3
category4
category5
The field name is 'category_tags'.
In my head, I can visualize the method to simply output all the categories, but I can't quite get my head around cleaning them up and grouping them to prevent duplicates.
I'm using CF8 with MySQL as the Database.
Any help would be very much appreciated!
I've hit a bit of a stumbling block on how best to achieve this.
I'm trying to output a list of categories for different products, however each field may contain a number of values, comma-separated. For example;
Row 1: category1,category2,category3
Row 2: category1, category4
Row 3: category5
The output I'm aiming for is;
category1
category2
category3
category4
category5
The field name is 'category_tags'.
In my head, I can visualize the method to simply output all the categories, but I can't quite get my head around cleaning them up and grouping them to prevent duplicates.
I'm using CF8 with MySQL as the Database.
Any help would be very much appreciated!