Jump to content

PHP Arithmetic


natalieG

Recommended Posts

Here is what I usually do...

 

$rownum = 0;
while($row = $db->fetch($result)){
//DB stuff here

$tr = $rownum % 2;

echo "<tr class=\"tr".$tr."\">";

//out put information

echo "</tr>";

$x++;

}

 

in the css

.tr0{
background-color:red;
}

.tr1{
background-color:white;
}

 

...something like that, hope it helps

Link to comment
https://forums.phpfreaks.com/topic/60270-php-arithmetic/#findComment-299779
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.