title: PDO looping through and printing fetchAll
body: <p>I'm having trouble getting my data from fetchAll to print selectively. </p>
  
  <p>In normal mysql I do it this way:</p>
  
  <pre><code>$rs = mysql_query($sql);
  while ($row = mysql_fetch_array($rs)){
     $id = $row['id'];
     $n = $row['n'];
     $k = $row['k'];
  }
  </code></pre>
  
  <p>In PDO, I'm having trouble. I bound the params, then I'm saving the fetched data into $rs like above, with the purpose of looping through it the same way..</p>
  
  <pre><code>$sth-&gt;execute();
  $rs = $query-&gt;fetchAll();
  </code></pre>
  
  <p>Now comes the trouble part. What do I do PDO-wise to get something matching the while loop above?! I know I can use print_r() or dump_var, but that's not what I want. I need to do what I used to be able to do with regular mysql, like grabbing $id, $n, $k individually as needed. Is it possible?</p>
  
  <p>Thanks in advance..</p>