Re: Re[2]: [PHP] How to format every secound row in a database result
| From: | Richard Lynch | Date: | Wed, 06 Apr 2005 04:46:56 +0000 |
| Subject: | Re: Re[2]: [PHP] How to format every secound row in a database result | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-212352@lists.php.net to get a copy of this message | ||
On Wed, March 30, 2005 11:08 am, Richard Davey said:
> Hello Leif,
>
> Wednesday, March 30, 2005, 6:54:15 PM, you wrote:
>
> LG> http://www.devtek.org/tutorials/alternate_row_colors.php
>
> There is no need to involve a math heavy modulus function just to
> alternate row colours! The following single line will do it just as
> well, swap the colours for whatever you need and echo them where
> required:
>
> $bgcolor = ($bgcolor === '#daf2ff' ? '#c9e1ef' : '#daf2ff');
And this is really faster?
In any appreciable way for a reasonable number of rows to present to the
user?
I don't really care which one you use, but if you're using === for
performance instead of %, I don't think you've got your reasons right.
If you just like === better stylisticly, hey, that's fine with me.
--
Like Music?
http://l-i-e.com/artists.htm