Public Voice Network
- looking for this kind of … 1414
- Why are hackers always ah… 1919
- blog 3028230282
- Ignore button please. 3232
- Mirror's Edge = vomit… 2424
- Your latest DESIGN purcha… 203203
- What does the future hold… 99
- ripping videos from sites 77
- best way to determine you… 1717
- Hen Party... 4141
- Your latest print purchas… 77
- trim/shave 88
- Happy VI Day
- skulls 5050
- Pic of the Day 1019410194
- water marks on letterhead… 44
- QBN Spam Report 2121
- serif fonts 1616
- Why, why, why? 1010
- FMT 112108 3232
- party @ simonyi's 33
- Vid of the Day 151151
- FFFind me a FFFound 44
- Carsten Holler - London 22
PHP Grouping Results 88 Responses
Last post: 8 months, 3 weeks ago | Thread started: Mar 4, 08, 9:48 a.m.
- maximillion_
look up "group by" clause on mysql.com


- Dog-earMar 4, 08, 9:56 a.m. – Permalink
- maximillion_
assuming you link the categories to the items via an id, i would put the category names into an array with the id as key. do yr query and loop through the items detecting when the cat id changes (record the last id used and then detect when its different) then use the id to ref the name in the array you made


- Dog-earMar 4, 08, 10:25 a.m. – Permalink
- heavyt
Agree with Maxi.
What I have done in the past is to use a var to hold the current category name. As you loop through your results, check each time if the category == that var. If it does, you are still in the same category. If it is not equal, you know you've moved on to the next cat.

- Dog-earMar 4, 08, 10:28 a.m. – Permalink


