Forum Moderators: coopster
Get Children
SELECT id, etc etc from categories where cat_id = ‘’
Count Number of record that have a cat ID
SELECT COUNT(*), category FROM pages GROUP BY category
And then bugger around combining the two or can it be done in one query?
Cheers
I have changed some of the names to make it easier to read.
SELECT COUNT(*), categories.name, categories.id, pages.category, categories.parent FROM categories, pages WHERE categories.id = pages.category AND pages.accepted = 'y' AND categories.parent = ‘$currentcat’ GROUP BY categories.id
This seems to work :)