Re: mysql output

From: Date: Wed, 20 Aug 2003 02:16:01 +0000
Subject: Re: mysql output
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-160118@lists.php.net to get a copy of this message
Anthony Ritter wrote:
I found the following and inserted it into my snippet for alternating backgoriund colors. However, I'm not sure I understand the logic. [snip]
if ($alternate == "1") { $color = "#eaf3da"; $alternate = "2"; } else { $color = "#d5eae9"; $alternate = "1"; }
It's just a long way of alternating colors. When $alternate is one, color1 is set, then $alternate is set to two. The next time through the loop, the color will be set to color2, then $alternate is set back to one. Then the cycle repeats. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com

« previous php.general (#160118) next »