title: MySQL - Return number of rows matching query data?
body: <p>I have a query as follows:</p>
  
  <pre><code>SELECT 1 FROM shop_inventory a JOIN shop_items b ON b.id=a.iid AND b.szbid=3362169 AND b.cid=a.cid WHERE a.cid=1 GROUP BY a.bought
  </code></pre>
  
  <p>The only thing I need to do with this data is work out the number of rows returned (which I could do with <code>mysqli -&gt; num_rows;</code>. However, I would like to know if there is a method to return the number of rows that match the query, without having to run <code>num_rows</code>?</p>
  
  <p>For example, the query should return one row, with one result, <code>number_of_rows</code>. </p>
  
  <p>I hope this makes sense!</p>