title: Count number of rows in each group in MySQLi
body: <p>I know this is basic but I find it tricky and couldn't quite phrase the question right in order to find the answer.</p>
  
  <p>What I'd like to do is take these tables -</p>
  
  <pre><code>Table names
  name   | nameID |
  -----------------
  Jhon   | 1
  Bob    | 2
  George | 3
  Kim    | 4
  
  Table mark
  nameID | child
  --------------
  1      | 0
  1      | 0
  1      | 1
  2      | 1
  2      | 0
  2      | 1
  3      | 0
  3      | 0
  4      | 1
  4      | 1
  4      | 1
  4      | 0
  </code></pre>
  
  <p>And then count how many times each name from table names appears in table mark with child=1, so you'll get:</p>
  
  <pre><code>name   | count
  --------------
  Jhon   | 1
  Bob    | 2
  Kim    | 3
  </code></pre>