title: SQL - Get all rows with same ID
body: <p>I'm trying to get all rows with the same id, 
  this is a example of the table:</p>
  
  <pre><code>Curs_ID     Cursistnr   payed
  Excel       2           500
  Internet    3           100
  C#          2           200
  </code></pre>
  
  <p>what I want to get out of the table is everything where <code>Cursistnr</code> is 2
  So what I need is 2 rows out of it: </p>
  
  <pre><code>Excel       2           500
  C#          2           200
  </code></pre>
  
  <p>EDIT: </p>
  
  <p>Oke, let me ask the question different.
  this is the table:</p>
  
  <pre><code>curs_code|Cursistnr|cijfer|payed
  Internet     50      5     2000.00
  Internet     88      7     2000.00
  Word         50      9     3300.00
  Word         88      9     3300.00
  Niam         88      6     850.00
  </code></pre>
  
  <p>I try to get everything from every row with cursistnr 88 for example
  So: </p>
  
  <p>Internet, 88 , 7, 2000.00
  Niam, 88, 6, 850.00
  word, 88, 9, 3300.00</p>
  
  <p>If I try SELECT * FROM c_regel WHERE cursistnr='$id'</p>
  
  <p>I only get:</p>
  
  <pre><code>array (size=8)
  'curs_code' =&gt; string 'Internet' (length=8)
  0 =&gt; string 'Internet' (length=8)
  'cursistnr' =&gt; string '88' (length=2)
  1 =&gt; string '88' (length=2)
  'cijfer' =&gt; string '7' (length=1)
  2 =&gt; string '7' (length=1)
  'betaald' =&gt; string '2000.00' (length=7)
  3 =&gt; string '2000.00' (length=7)
  </code></pre>
  
  <p>the php code I'm using:</p>
  
  <pre><code>function cursusDone($magazijn, $id){
    $sql = "SELECT curs_code FROM c_regel WHERE cursistnr='$id'";
    $query = $magazijn-&gt;query($sql);
    return $query-&gt;fetch();
  }
  
  $done = cursusDone($magazijn,$id);
  var_dump($done);
  </code></pre>
  
  <p>I think it has something to do with the sql table,</p>
  
  <p>if I try SELECT * FROM c_regel I only get te first row.
  Don't know what's wrong here</p>