[snip]
Is there a way for me to do one of the following:

1) Test to see if $i is an even or odd number?
2) Grab more than one line from the database at a time, and just put in two
table rows at once?
[/snip]

<?
$rowcount = 0;
while($dbrowa = mysql_fetch_object($dbseta)){
        $dbrowb = mysql_fetch_object($dbsetb);
//change the color of alternating rows
$rowcount ++;
if ($rowcount == 1){
        print("<tr bgcolor=\"#FFFF99\">\n");
        }
        elseif ($rowcount <> 1) {
                print("<tr>\n");
                $rowcount = 0;
        }


This way you don't have to know even or odd.
$rowcount is 0
$rowcount is set to one and printed in a different color
$rowcount is set to two, which is not equal to one, so does elseif and is
set to zero

HTH!

Jay



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to