Re: array loops
| From: | Niklas Alberth | Date: | Fri, 01 Dec 2000 15:15:02 +0000 |
| Subject: | Re: array loops | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28212@lists.php.net to get a copy of this message | ||
while(....)
{
$i =+ 1;
$i % 2 ? print "color 1" : "color 2";
}
Hope that puts you on the right track.
--Niklas
Hi I hope someone will be able to help with my mental block. I am pulling some details from the db and putting these into a table. I want each row to alternate the background color. I have a while loop printing out the db results and 2 background colors in a an array, so I need it print each of the colors, then start again till there are no more results. I can't seem to work it out trhough. Any help will be gratefully received M@