title: Joining 3 tables and count different fields
body: <p>I have a query in which I loop through an itemlist(alerts), these alerts have replies which I want to know how many replies that alert/item has, these alerts/items also have some sort of like(interaction) button which I want to know how many people liked it, now I have this query which gives me how many replies I have, but I don't know how I can count how many interactions it has... Could someone take a look at it and maybe help me ? </p>
  
  <p>This is my Query so far: </p>
  
  <pre><code>SELECT a.title, a.lat, a.lon, a.alert_content_id, a.date_added, count(*) FROM `alerts` a 
     LEFT JOIN `reply` r ON 
         r.alert_id = a.alerts 
     LEFT JOIN `interactions` i ON 
        i.alert_id = a.alerts 
     GROUP BY a.title, a.lat, a.lon, a.alert_content_id, a.date_added
  </code></pre>
  
  <p>Now this count returns the number of replies, how can I count the number of interactions as well? 
  This is what a desired result would look like </p>
  
  <pre><code>|a.title|a.lat|a.lon|a.alert_content_id|a.date_added|count(replies)|count(interactions)|
  </code></pre>
  
  <p>count replies is number of rows that <code>a.alerts == r.alert_id</code> 
  and count interactions is number of rows that <code>a.alerts == i.alert_id</code></p>