hi all...
how to categorize multiple values in a table field.
for ex:-

 id   Field
    1    Adult
    2    Adult
    3    Child
    4    Child
    5    Senior
    6    Senior

i.e, 3 category Adult as 1,Child as 2, Senior as 3
i want the result as like this
count catname
1 of 1
2 of 1
1 of 2
2 of 2
1 of 3
2 of 3

please help me to solve this.... tnx in advc...

Recommended Answers

All 2 Replies

Did you get this from database? If so, use database query to group them for you. You could use COUNT(*) and GROUP BY keyword in the database.

Member Avatar

Your data looks like the reverse of what you'd find in a relational model:

items1 (id, cat_id)
1 1
2 1
3 2
4 2
5 3
6 3

cats (id, name)
1 Adult
2 Child
3 Senior

Difficult to see what's going on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.