title: Count the rows with same ID in php
body: <p>I'm trying to count the rows with the same id</p>
  
  <pre><code>|curs_code|cursistnr|Mark|Payed|
      C#        20       6    50
      PHP       25       8    100
      C#        8        7    100
  </code></pre>
  
  <p>the output needs to be</p>
  
  <p>C#, 2times</p>
  
  <p>I've tried </p>
  
  <pre><code>$sql = "SELECT count(curs_code) as 'count_of_curs' FROM cursus where curs_code='$id'";
  $query = $magazijn-&gt;query($sql);
  return $query-&gt;fetchAll());
  </code></pre>
  
  <p>but gives me this output: </p>
  
  <pre><code>C#
   array (size=1)
    0 =&gt; 
     array (size=2)
      'count_of_curs' =&gt; string '1' (length=1)
    0 =&gt; string '1' (length=1)
  
  PHP
   array (size=1)
    0 =&gt; 
     array (size=2)
      'count_of_curs' =&gt; string '1' (length=1)
    0 =&gt; string '1' (length=1)
  </code></pre>
  
  <p>your thought about this?</p>