I'm selecting data from mysql into an HTML table and looking for a way to change the css of the depending on that particular row data.
So far I have had the following code:
CSS
.rowColor {
background-color: <?php $row_color ?>
}
PHP
if ($row['status'] === "approved") {
$row_color = "green;";
} else {
$row_color = "orange;";
}
HTML
<tr class="rowColor">
<td>{$row['firstName']}</td>
<td>{$row['lastName']}</td>
<td>{$row['status']}</td>
Currently each row will become orange regardless of what the status datas is.