I can't figure out how to display data from mysql in separate html tables within one loop.
Here is how my mysql table looks:
date name
---- ----
2011-02-02 Katrin
2011-02-02 Michael
2011-02-02 Joe
2011-02-05 David
2011-02-05 Steve
etc...
NOTE: I know how to get data from the table.
The idea is to create individual table based on date. For example here is html that should be generated;
<table>
<tr>
<td>date</td><td>name</td>
<td>2011-02-02</td><td>Katrin</td>
<td>2011-02-02</td><td>Michael</td>
etc..
</tr>
</table>
<table>
<tr>
<td>date</td><td>name</td>
<td>2011-02-05</td><td>Joe</td>
<td>2011-02-02</td><td>David</td>
etc..
</tr>
</table>
Here is what I try.
I have counted how many distinct dates are fetched from table. After that I use "for" statement to "draw" the tables.
In that case total_dates is 2
<?php for($x = 0; $x < $total_dates; $x++): ?>
<table>
<tr>
<tr>
</table>
<?php endif; ?>
So far so good. That code draw the tables. The problem is that I can't figure out programic logic how to display data within tables so every table to contain data grouped by date.