title: Looping through a query into separate tables
body: <p>I call my query ok</p>
  
  <pre><code>    $sql = "Call new_c02(1,1,'2014-01-10','2014-01-10')";
      if(!$result = $db-&gt;query($sql)){
  die('There was an error running the query [' . $db-&gt;error . ']');
      }
  </code></pre>
  
  <p>and it generates a table thus:</p>
  
  <pre><code>Acc  Data1  Data2  Data3    
  1    x     y     z
  1    a     b    c
  2    x     y    z
  2    a     b    c
  </code></pre>
  
  <p>I can throw this into a table using</p>
  
  <pre><code>&lt;table&gt; &lt;?php while($row = $result-&gt;fetch_assoc()){ ?&gt;                  
  &lt;tr&gt;
    &lt;td&gt;
    &lt;?php    echo $row['accounts'] . '&lt;br /&gt;'; ?&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>etc etc</p>
  
  <p>However I would like to be able to generate a separate table for every different account so i have a table for Acc 1 and a separate table below it for Acc2 and so on until I am exhausted of Accs in the query.
  Just not sure how to loop through the query to make a separate table for each</p>
  
  <p>Help really appreciated
  Simon</p>