Hi guys and gals,
I have a table that displays the rows of companies. Each row displays the company, description, and whether they are a member or not. As of right now, it pulls the data from the table and displays it fine. I even used some code from this site to make the rows alternate colors. All is good. Now my challenge is to make the row of the company that is a member, to be a different color...
<?php
mysql_connect("localhost", "user", "pass") or die(mysql_error());
mysql_select_db("table") or die(mysql_error());
$result = mysql_query("SELECT * FROM cmscompany ORDER BY company ASC")
or die(mysql_error());
$color1 = "#ebebeb";
$color2 = "#dddddd";
$row_count = 0;
echo "<table class='listing'>";
echo "<tr> <th>Company</th> <th>Description</th> <th>Member</th> </tr>";
while($row = mysql_fetch_array( $result )) {
$row_color = ($row_count % 2) ? $color1 : $color2;
$member = "member";
$yes = "yes";
if($member == yes){
echo "<tr valign='top'><td bgcolor='#33ccff'>";
echo '<a href="viewcompany.php?id='.$row['ID'].'">';
echo $row['company'];
echo '</a>';
echo "</td><td bgcolor='#33ccff'>";
echo $row['thearticle'];
echo "</td><td bgcolor='#33ccff'>";
echo $row['member'];
echo "</td></tr>";
} else {
echo "<tr valign='top'><td class='listing' bgcolor='$row_color'>";
echo '<a href="viewcompany.php?id='.$row['ID'].'">';
echo $row['company'];
echo '</a>';
echo "</td><td class='listing' bgcolor='$row_color'>";
echo $row['thearticle'];
echo "</td><td class='listing' bgcolor='$row_color'>";
echo $row['member'];
echo "</td></tr>";
$row_count++;
}
}
echo "</table>";
?>
Am I close?
Thanks so much for any help!