title: OOP select query works but unsure how to process the results
body: <p>I'm turning my hand to OOP and am having trouble getting my head around how to process the results. This is a query I'm using.  </p>
  
  <pre><code>   $rows = $db-&gt;select("SELECT * FROM tblriskregister 
      WHERE riskSessionId=$riskSessionId ");
  </code></pre>
  
  <p>I can print out elements of the results by using $rows[0]['aname'].  But I don't know how to iterate through the results.  Everything is in $rows but no matter what I have tried I can't seem to iterate through. I've tried </p>
  
  <pre><code>    while($rows-&gt;num_rows &gt;0) and
      $rows-&gt;fetch_assoc()
  </code></pre>
  
  <p>but everything I try doesn't work.  The initial query to the database has returned everything to $rows as an array but I can't work out how to go through it and print out my rows.  </p>