I’ll try to explain this as best as I can:
I have a table in a loop that displays results of runners organized by age ($row_getResults[‘heading’]) then organized by whether they ran the ‘1 Mile’ ($row_getResults[‘mile’]) or the ‘8K’.
The table has ‘<th>’ headers of:
Place
Name
City
Bib No.
Age
Overall
Time
Pace
within each ‘<th>’ cell in a row below the heading ($row_getResults[‘heading’]). The queried content displays correctly and is organized just fine. What I need help is to not have the ‘<th>’ repeat if the content falls under the same $row_getResults[‘heading’]. I only want one ‘<th>’ row per table of results.
The following results are displayed with one table:
Place Name City Bib No. Age Overall Time Pace
1 Scott Mac Sunnyvale, CA 12 9 12 3:00.3 3:00/M
Place Name City Bib No. Age Overall Time Pace
2 Jerry Marc Los Angeles, CA 11 12 9 4:12.1 4:12/M
Imagine how this looks with 100 records. EEK!
The ‘<th>’ row is static.
<?php do { ?>
<?php if ($row_getResults['mile'] !=$mile) { echo "<h2 style='font-size: 18px; text-align: center;'>".$row_getResults['mile']."</h2>"; $mile = $row_getResults['mile']; } ?>
<?php if ($row_getResults['heading'] !=$heading) { echo "<h2 style='text-transform: uppercase; font-size: 13px; color: #333;'>".$row_getResults['heading']."</h2>"; $heading = $row_getResults['heading']; } ?>
<table width="95%" border="0" cellspacing="0" cellpadding="0" summary="this table displays the almond blossom fun run results for one mile and 8K, organized by ages of femails and males and by place, name, city, bib number, age, overall, time and pace.">
<caption>
<span style="display: none;">Almond Blossom Fun Run 2010 Results</span>
</caption>
<tr>
<th scope="col">Place</th>
<th class="name" scope="col">Name</th>
<th scope="col">City</th>
<th scope="col">Bib No.</th>
<th scope="col">Age</th>
<th scope="col">Overall</th>
<th scope="col">Time</th>
<th scope="col">Pace</th>
</tr>
<tr>
<td><?php echo $row_getResults['abr_place']; ?></td>
<td class="name"><?php echo $row_getResults['abr_name']; ?></td>
<td><?php echo $row_getResults['abr_city']; ?></td>
<td><?php echo $row_getResults['abr_bibNo']; ?></td>
<td><?php echo $row_getResults['abr_age']; ?></td>
<td><?php echo $row_getResults['abr_overall']; ?></td>
<td><?php echo $row_getResults['abr_time']; ?></td>
<td><?php echo $row_getResults['abr_pace']; ?></td>
</tr>
</table><?php } while ($row_getResults = mysql_fetch_assoc($getResults)); ?>