Jump to content

MySQL COUNT


brianbehrens

Recommended Posts

I'm a little unclear exactly how to use this, or if I can even use thing in conjunction with pulling out the proper amount of data needed.

 

Here's my current query

 

$sql = "SELECT * FROM photo_albums pa LEFT JOIN 
photos p ON pa.pa_id = p.album_id  ORDER BY pa.pa_id DESC";

 

I want to pull out all of my albums and in turn find out all the associated photos with that album.  I'm interested in finding out how many photos are in each album.  I can do it in PHP based on the current query, but after doing some reading it seems I could do this in mySQL.  I'm just unclear if it can be done in the same query or if it would take another one all together?

 

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/75446-mysql-count/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.