Reply to Re: Re[2]: [PHP] How to format every secound row in a database result

Your name:

Reply:


Posted by Richard Lynch on 04/06/05 07:46

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация