Re: [PHP] Re: Alternating Table Rows, Part Deux..

2002-05-10 Thread Glenn Sieb
On 04:58 PM 5/10/2002 -0500, Miguel Cruz wrote: >But he's dealing with cases where the company name remains the same but >other data in the row changes (for instance, a company with multiple >offices, where you wanted to list the phone number and address for each). >GROUP BY would discard that oth

Re: [PHP] Re: Alternating Table Rows, Part Deux..

2002-05-10 Thread Austin Marshall
Miguel Cruz wrote: > On Fri, 10 May 2002, Austin Marshall wrote: > >>>This not only takes care of the table row colors, but also removes >>>duplicate company names so it looks MUCH neater this way : >> >>Is there not a GROUP BY clause in MS SQL? I'm pretty sure there is. If >>you group th

Re: [PHP] Re: Alternating Table Rows, Part Deux..

2002-05-10 Thread Miguel Cruz
On Fri, 10 May 2002, Austin Marshall wrote: >> This not only takes care of the table row colors, but also removes >> duplicate company names so it looks MUCH neater this way : > > Is there not a GROUP BY clause in MS SQL? I'm pretty sure there is. If > you group the query by company name

[PHP] Re: Alternating Table Rows, Part Deux..

2002-05-10 Thread Austin Marshall
Glenn Sieb wrote: > Hey everyone! > > Thanks for all the hints--here's what my boss and I eventually came out > with: > > /* ## > ## And for every row of data we pull, we create a table row... > ## */ > $company = 0; >

[PHP] Re: Alternating table rows...

2002-05-10 Thread Glenn Sieb
Austin, you rock :) I've only just started with PHP recently, and was introduced to the ternary operators by reading Rasmus' book (great job, Rasmus!!!), so I'm learning as I go here :) Thanks buddy! Glenn On 01:50 PM 5/10/2002 -0500, Austin Marshall wrote: >$color=($i%2) ? "grey" : "white; wi

[PHP] Re: Alternating table rows...

2002-05-10 Thread Austin Marshall
Glenn Sieb wrote: > Hi everyone, > > I have a PHP script that reads data from an MS SQL server and outputs > the data into a table. I've been asked if I can alternate the colors of > the rows to make the report more legible. The relevant piece of code > looks like: > > for ($i = 0; $i < mssql