Re: [PHP] Swapping background color

2001-08-29 Thread Miles Thompson

In the generated HTML produced by your WHILE statement you can alternate 
colours. Here's one approach ... the code is bounded by table tags not seen 
here, the query has been executed and assigned to $result:
while( $row = mysql_fetch_array( $result ) )
{
 if( ( $nCounter++ % 2 ) == 0 )
 { echo ""; }
 else
 { echo ""; }
 echo "", $row[ no], "", $row[ date], "", 
number_format ($row[ yBidAmount ], 2, "," , " " ), "";
}

Even rows are green, and odd rows are whatever that other colour is, a 
deeper green I believe. Now, you may not like my choice of colours, but I 
was experimenting. The client settled on white and gray. Sigh.

Miles

At 10:57 AM 8/29/01 -0700, Alnisa Allgood wrote:
>I'm not certain if this is more an HTML question or a PHP issue, but...
>
>I'm creating an account management system, where each client can have 
>multiple accounts, each account can have multiple users, and each user can 
>make multiple requests.
>
>I've created a SQL Query that returns a list of all user requests, based 
>on userID. I'd like to format the display so that it looks like:
>
>(white)  $no   $date $subject $priority $status
>(grey)$no   $date $subject $priority $status
>
>how do I tell php to switch the background color of a row in a table, 
>automatically?
>
>Alnisa
>--
>   .
>Alnisa  Allgood
>Executive Director
>Nonprofit Tech
>(ph) 415.337.7412  (fx) 415.337.7927
>(url)  http://www.nonprofit-techworld.org
>(url)  http://www.nonprofit-tech.org
>(url)  http://www.tech-library.org
>   .
>Nonprofit Tech E-Update
>mailto:[EMAIL PROTECTED]
>   .
>applying technology to transform
>   .
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Swapping background color

2001-08-29 Thread Alnisa Allgood

I'm not certain if this is more an HTML question or a PHP issue, but...

I'm creating an account management system, where each client can have 
multiple accounts, each account can have multiple users, and each 
user can make multiple requests.

I've created a SQL Query that returns a list of all user requests, 
based on userID. I'd like to format the display so that it looks like:

(white)  $no   $date $subject $priority 
$status
(grey)$no   $date $subject $priority 
$status

how do I tell php to switch the background color of a row in a table, 
automatically?

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
applying technology to transform
   .

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]