I posted the code at
http://go3net.com/color_by_name.php
============
This is what is in the page:
$list = ("select * from table order by last name😉
then
<?
$color = "tan";
$lastname = "";
while ($row=mysql_fetch_row($list))
{
if ($lastname != $row[0])
{
if ($color = "tan") $color = "beige";
else $color = "tan";
}
?>
<tr>
<td class="body_font" width="13%" valign="top" bgcolor="<? echo $color; ?>">
<font face="Arial, Helvetica, sans-serif" size="1">
<?= $row[0] ?>
</font></td>
<td class="body_font" width="15%" valign="top" bgcolor="<? echo $color; ?>">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="1">
<?= $row[1] ?>
</font> <font face="Arial, Helvetica, sans-serif" size="1">
<?= $row[2] ?>
</font><font face="Arial, Helvetica, sans-serif" size="1">,
<?= $row[3] ?>
</font></div>
</td>
<td class="body_font" width="8%" valign="top" bgcolor="<? echo $color; ?>">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="1">
<?= $row[4] ?>
</font></div>
</td>
<td class="body_font" width="6%" valign="top" bgcolor="<? echo $color; ?>">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="1">
<?= $row[5] ?>
</font></div>
</td>
<td class="body_font" width="6%" valign="top" bgcolor="<? echo $color; ?>">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="1">
<?= $row[6] ?>
</font></div>
</td>
<td class="body_font" width="52%" valign="top" bgcolor="<? echo $color; ?>">
<font face="Arial, Helvetica, sans-serif" size="1"> </font></td>
</tr>
<?
}
?>