title: MySQL COUNT in LEFT JOIN WHERE
body: <p>I'm not an expert, keep this in mind please when answering my question...
  I've read many other examples about here on stackoverflow, but I simply don't understand how to use it with my task.</p>
  
  <p>I got an Album database table, and a Photo database table:</p>
  
  <p>table_album:</p>
  
  <pre><code>album_id   album_creatoruser_id
  -------------------------------
     1           777
     2           777
     3           777
  </code></pre>
  
  <p>table_photos:</p>
  
  <pre><code>photo_id   photo_album_id
  -------------------------
     1            1
     2            1
     3            1
     4            1
     5            2
     6            2
     7            3
     8            3
     9            3
  </code></pre>
  
  <p>Now I'd like to get the sum of all photos, created by a user, in my example <code>album_creatoruser_id=777</code></p>
  
  <p>I'm sure it would be possible directly in MySQL, with one query or subqueries, or with LEFT JOIN or GROUP BY, but I can't get it working because I don't understand the logic to build up this query.</p>
  
  <p>Any help how to count the <code>photo_id</code> rows for all <code>album_id</code>'s a specific <code>album_creatoruser_id</code> has created would be nice!</p>
  
  <p>In short: How many photos <strong>album_creatoruser_id 777</strong> got?</p>