selecting id and count(id) from table in mysql

Zoc

New Member
I am trying to make a photo album system in php and mysql.I have this code for list all photo albums:\[code\]SELECT albums.*, count(pictures.id) AS countpic FROM albumsLEFT JOIN pictures ON (albums.id=pictures.album_id)GROUP BY albums.id ORDER BY albums.date DESC");\[/code\]I want to list title of photo albums with photo thumbnails (thumb_id si written in table pictures) and also with number of all pictures assigned to each albums.Dont you know how to select thumb_id and also number of all pictures in album by using one select?Thanks
 
Back
Top