Just another version.
<?php
function useColor() {
static $ColorValue; // remember the last color
if ($ColorValue == "#00FF00")
{
$ColorValue ="#CCFFCC";
else
{
$ColorValue ="#00FF00";
}
return($ColorValue);
}
?>
the call
...
$RowColor = useColor();
...
echo '<td bgcolor='.$RowColor.'>';
- Jp
At 15:46 10/05/02, you wrote:
>[snip]
><?
>$rowcount = 0;
>while($dbrowa = mysql_fetch_object($dbseta)){
> $dbrowb = mysql_fetch_object($dbsetb);
>//change the color of alternating rows
>$rowcount ++;
>if ($rowcount == 1){........too many lines of code
>[/snip]
>
>I get humbled by this list every day. Could I have Single PHP Lines for a
>thousand Alex? Dammit, still thinking like an old Basic programmer...
>
>Jay
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
________________________________________________________
Juan Pablo Aqueveque <[EMAIL PROTECTED]>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Cat�lica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php