title: Trying to count how many certain types of award a dog has in results table
body: <p>I have a dog show results website. I am trying to count and show how many certain types of award a dog has. 
  There are two tables. 
  Table 1
  Result table - with ResultID, dog_id and Award (for example I am trying to find out how many strings that match 'DCC' in award column).
  Table 2 
  Dog table - with dog_id.</p>
  
  <p>I have tried an inner join but it counts is not working correctly. For example, the count should show 1 as I know a certain dog has only 1 'DCC' but it shows 2505 not sure where it's getting this figure from?</p>
  
  <pre><code>&lt;?php
   $query = "SELECT result.resultID, result.dog_id, result.award, COUNT(*) AS dcc
          FROM result INNER JOIN dogs
          ON result.dog_id = dogs.dog_id
          GROUP BY result.dog_id, result.award
          ORDER BY dcc";
  
          $select_all_dcc = mysqli_query($connection, $query);
          $dcc_counts = mysqli_num_rows ($select_all_dcc);
          echo    "&lt;strong class='amount'&gt;{$dcc_counts}&lt;/strong&gt;"
  </code></pre>