sophielois
Technical User
Is it possible to change the colour of a certain row within a mysql result.
ill try and explain what i mean
How would i make
a row appear shaded if $row->completed == 1
eg The row is a different colour to the rest if $row->completed == 1
Is this possible???
Soph
ill try and explain what i mean
Code:
<?php
$result = mysql_query("SELECT * FROM candidate ORDER BY first_name");
while($row = mysql_fetch_object($result))
{
echo "<tr bgcolor='#ffffff'>";
echo "<td>$row->first_name $row->last_name</td>";
echo '<td>';
if ($row->level_2 == 1) {
echo "Car 2";
} else{
echo "Car 3";
}
echo '</td>';
echo "<td>$row->reg_num</td>";
echo "<td>$row->wrk_place</td>";
echo "<td>$row->ass_name</td>";
echo "<td>$row->i_name</td>";
echo "<td>$row->signup_date</td>";
echo '<td>';
if ($row->completed == 1) {
echo "YES";
} else{
echo "NO";
}
echo '</td>';
echo "<td><a href=\"/admin/can/can_view.php?userid=$row->userid\">View</a></td>";
echo "</tr>";
}
?>
How would i make
a row appear shaded if $row->completed == 1
eg The row is a different colour to the rest if $row->completed == 1
Is this possible???
Soph