Click to See Complete Forum and Search --> : [RESOLVED] need help to count


demiurgen
05-03-2007, 12:54 AM
i have a image gallery with different albums/categories.
on the front page i display an image from that album and under it i would like to display how many images that the album contains

does anyone know how count each category?

say i have 2 different categories, one has 1 image and the other has 11 images
so the result i want is two rows with 12 and 1

mattyblah
05-03-2007, 04:07 PM
something like:

select category, count(*) as num_images from categories group by category

demiurgen
05-04-2007, 07:22 AM
great! that worked!! thanks!!!