title: Dynamic table columns with PHP
body: <p>I want to make a table with 2 dynamic columns using one MySQL query. I was able to make the first row of columns but the second row is just blank. Any ideas? Here is my current code:</p>
  
  <pre><code>&lt;?php
  $query_dates ="SELECT uploadedby, count(item) as item, date_format(uploaddate, '%m-%d-%y') as date FROM `imsexport` WHERE uploadedby='Gerry Dellosa' and uploaddate between '2012-12-25' and '2013-01-15' GROUP BY date ORDER BY uploaddate ASC";
  $result = mysql_query($query_dates,$prepress) or die(mysql_error());
  $row_dates = mysql_fetch_assoc($result);
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table width="200" border="1"&gt;
    &lt;tr&gt;
      &lt;td&gt;NAME&lt;/td&gt;
  &lt;?php do{?&gt;
      &lt;td&gt;&lt;?php echo $row_dates['date']?&gt;&lt;/td&gt;
  &lt;?php } while ($row_dates = mysql_fetch_assoc($result)); ?&gt;
   &lt;/tr&gt;
   &lt;tr&gt;//This is the second row set of dynamic columns
     &lt;?php do{?&gt;
      &lt;td&gt;&lt;?php echo $row_dates['date']?&gt;&lt;/td&gt;
     &lt;?php } while ($row_dates = mysql_fetch_assoc($result)); ?&gt;  
   &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>