title: get number of rows with pdo
body: <p>I have a simple pdo prepared query:</p>
  
  <pre><code>$result = $db-&gt;prepare("select id, course from coursescompleted where person=:p"); 
  $result -&gt;bindParam(':p', $q, PDO::PARAM_INT);
  $result-&gt;execute();
  $rows = $result-&gt;fetch(PDO::FETCH_NUM);
  echo $rows[0];
  </code></pre>
  
  <p>the echo seems to be returning the ID value of the record, not the number of records returned by the query?</p>
  
  <p>any idea or explanation for this?</p>