title: MySQL associated table COUNT() and GROUP BY
body: <p>I am doing a pretty normal routine, but having a tough time getting my output correct.</p>
  
  <p><strong>I have two tables:</strong> *ads_list* (listings) and *ads_cate* (categories).</p>
  
  <p>I am currently displaying my category list like so:</p>
  
  <pre><code>SELECT id, cateName FROM ads_cate ORDER BY cateName
  </code></pre>
  
  <p><strong>What I am trying to achieve:</strong> count of all items in each category in this format:</p>
  
  <p>Category  |  Number of Ads</p>
  
  <p>categoryName 56</p>
  
  <p><strong>This is my current code</strong>, and have been tweaking but getting no output in my array:</p>
  
  <pre><code>SELECT 
  
  ads_cate.id, 
  ads_cate.cateName, // Category Name
  
  ads_list.id, 
  ads_list.COUNT(title), // Title of ad
  ads_list.Category // Relational Category ID INT(11)
  
  FROM
  
  ads_cate, 
  ads_list
  
  GROUP BY cateName 
  ORDER BY cateName
  </code></pre>
  
  <p>I am calling in all required fields and running a COUNT() on my title field (as these are unique for each ad) and then I am grouping by cateName which also seems correct.</p>