i have this designing my table:
<style type="text/css">
tr {
background: <?php echo $colors[$status];?>;
color:white;
}
</style>
and
$status = $row[4];//value is 0
$colors = array("lime", "red");
The value in the database is 0.
The $status variable defines what color the table row should be. However the row is never lime. Is my array wrong or something else?
make sure the order is correct.
the order should be something like this:
your issue could be due to the fact that
$colorswas never declared before you started using it