Forum Moderators: coopster

Message Too Old, No Replies

dynamic tables, supressing info

don't want to display dulpicate values

         

maxxtraxx

11:47 pm on May 30, 2003 (gmt 0)

10+ Year Member



does anyone know of a way to suppress data in a dynamic table?

for example: i am generating a table with a do/while loop and displaying user info in this table. works great. however, i have a column that displays the usergroup, which is fine, but several ppl are in the same usergroup. once again fine, but i would just like to see the first instance of this displayed.

so, if my first 3 records are in the "Staff" group i only want to see the first persons record display that, and it be blank for the next 2 ppl.

any advice would be much appreciated.

thanks!

daisho

4:25 am on May 31, 2003 (gmt 0)

10+ Year Member



why?

if I understand your questions right (though I don't know if I do) I'd just ignore the extra data in PHP.

daisho.

maxxtraxx

8:21 pm on May 31, 2003 (gmt 0)

10+ Year Member



well, mainly because my users are a bunch of sissies and they don't want the page to look "cluttered"!

=)

so they asked me if it was possible and being the good little developer and said i would look into it...

daisho

8:55 pm on May 31, 2003 (gmt 0)

10+ Year Member



I'd say then your easiest way is to do it in PHP. Just simply not print the extra data. Leave the SQL Query as is.

daisho.

maxxtraxx

1:19 am on Jun 1, 2003 (gmt 0)

10+ Year Member



yep, i think i got it!

<?php $lastTime = '0';?>
<?php do {?>
<tr bgcolor="#CCCCCC" class="datatext">
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><a href="avail_results.php?<?php echo $keepNone.(($keepNone!="")?"&":"")."sid=".$row_rsRides['ScheduleID']?>"><?php if( $lastTime!= $row_rsRides['Time'] ) echo $row_rsRides['Time']; else echo '&nbsp;';?></a></td>
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><?php echo $row_rsRides['Name'];?></td>
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><?php echo $row_rsRides['Weight'];?></td>
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><?php echo $row_rsRides['Height'];?></td>
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><?php echo $row_rsRides['PhoneNo'];?></td>
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><?php echo $row_rsRides['NumAdults'];?></td>
<td align="center" bgcolor="#FFFFFF" class="smtitletext"><?php echo $row_rsRides['NumChildren'];?></td>
</tr>
<?php $lastTime = $row_rsRides['Time'];?>
<?php } while ($row_rsRides = mysql_fetch_assoc($rsRides));?>

took me awhile but i think this will work... =)