Originally posted by archangel_617b
1 : while($row = mysql_fetch_assoc($rid))
2 : {
3 : if ($date != $row['date'])
4 : {
5 : $date = $row['date'];
6 : print('<br />'.$date.'<br />');
7 : }
8 :
9 : // print the data
10:}
[/B]
Okay, you have line 1: which is the main loop which you use. That's fine.
Line 3: $date holds the value of the current date, right? It is null the first time through the loop so it will always fall through to line 5:
Line 5: $date is updated to the new date of the next series of data.
Line 6: Since this new date has not been printed, it gets printed here. The next time through the loop, if it is another item for the same date, then lines 5: and 6: will not be executed and so you will not have duplicate dates displayed.
Line 9: This is where you print the <table> stuff that you have for the images.
Please be specific about which part you do not understand. The problems you are having are fundamental features of procedural programming.