alternating table entry colors
| From: | Brad Ciszewski | Date: | Sat, 11 Dec 2004 00:19:35 +0000 |
| Subject: | alternating table entry colors | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-204012@lists.php.net to get a copy of this message | ||
i need some assistance making my table (rows) change color for every other
data. here is what i have so far, but i get a "unexpected T_STRING error".
this error's line is: if($thisRow mode 2 == 0){
+=+=+ SCRIPT BELOW +=+=+
$thisRow = 0;
$query = mysql_query("SELECT * FROM security_images ORDER BY ID DESC");
while($gt=mysql_fetch_array($query)){
if($thisRow mode 2 == 0){
$backgroundColor = "#CCCCCC";
}else{
$backgroundColor = "#FFFFFF";
}
extract($gt);
echo ?>
<tr bgcolor="<?PHP echo($backgroundColor); ?>">
<td><?PHP echo($ID); ?></td>
<td><?PHP echo($ipAddr); ?></td>
<td><?PHP echo($area); ?></td>
<td><?PHP echo($insertdate); ?></td>
<td><?PHP echo($referenceid); ?></td>
<td><?PHP echo($hiddentext); ?></td>
</tr>
<?PHP
$thisRow++
} ?>
+=+=+ SCRIPT ABOVE +=+=+
thanx in advance!
- Brad
www.BradTechnologies.com - Web Services