Re: Alternating Table Rows, Part Deux..
| From: | 1LT John W. Holmes | Date: | Fri, 10 May 2002 20:33:51 +0000 |
| Subject: | Re: Alternating Table Rows, Part Deux.. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97011@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Robert Cummings" <robert.cummings@webmotion.com>
> Glenn Sieb wrote:
> > $cname =
(strcmp($previous,$line[0])
> > ? $line[0] : " ");
> > print ("<TR
> >
BGCOLOR=#$color>\n\t<TD>$line[2]</TD>\n\t<TD>$cname</TD>\n\t<TD>$line[3]</TD
>\n</TR>\n");
> > $previous = $line[0];
> > }
> > print ("</TABLE>");
> >
> > This not only takes care of the table row colors, but also removes
> > duplicate company names so it looks MUCH neater this way :))))
>
> YIKES! I thought there was a SQL keyword for returning a unique
> rowset.
Read the code again, that's what I first thought, too. He's just not
printing multiple values for the first table cell. So if the current row has
the same company name, just print a blank cell, then print the rest of the
data for that row.
---John Holmes...