[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; * * [EMAIL PROTECTED] * * * *************************************** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php