tr color variations help in PHP
Posted: Thu Dec 19, 2002 2:22 pm
i am working making the colors alternate on each row of output from a query, but have not nailed it. i know comming from a coldfusion (ouch) background that it would be iif mod. any ideas with php? (ignore the db connection information i am working off of memory and i need a bit more programming to get it down)
any ideas on where to start??!?
thanx for any sugestions!
soshea
Code: Select all
<?php
$dbi = (database = yadayada, user=postgres);
$sql = $pg_connect($dbi, "select * from testtable");
$rows = $pg_fetchrow($sql);
//here is the area ignore the above, doing it off memory
for ($i=0;$i<$rows;$i++) {
echo "<table><tr><td> test output </td></tr>";
// this is where the alternating colors should be
echo "<tr bgcolor = #DDDDDD>
// rest of code here
?>thanx for any sugestions!
soshea