RE: [PHP] Brain Fart- table formatting help

From: Date: Mon, 29 Jul 2002 13:18:46 +0000
Subject: RE: [PHP] Brain Fart- table formatting help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110162@lists.php.net to get a copy of this message
[snip] I'm trying to format the output of a db query with alternating row colors, the thing is the usual if ($i%2) {} will not work here because the alternating colors do not necessarily fall on odd or even rows. [/snip] <?php $i = 0; while($exrows = mysql_fetch_object($dbcdrex)){ $bgcolor = ($i++ & 1) ? '#FFFFFF' : '#CCCCCC'; //other table stuff ?> HTH! Jay Minds are like parachutes…they only function when OPEN ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * ************************************* *************************************** * * * Texas PHP Developers Meeting * * Spring 2003 * * T Bar M Resort & Conference Center * * New Braunfels, Texas * * Interested? Contact; * * jay.blanchard@niicommunications.com * * * ***************************************

« previous php.general (#110162) next »