I have looked at some examples but don't seen to be able to find what I am looking for.
I need to make the cells in a table change colour if the amount in quantity is less than the threshold.
<?php
$result = mysql_query("SELECT * FROM stock WHERE type='hardware' ORDER BY item ASC");
echo "<table border='1' align='center' width='600'>
<tr>
<th align='left' bgcolor='#00a3e0'><font face='Arial'>Hardware Stock Item</font></th>
<th bgcolor='#00a3e0'><font face='Arial'>Quantity</font></th>
<th bgcolor='#00a3e0'><font face='Arial'>Location</font></th>
</tr>";
while($row1 = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><font face='Arial'>" . $row1['item'] . "</font></td>";
if ($row1['quantity'] => $row1['threshold']) {
echo "<td align='center'><font face='Arial'>" . $row1['quantity'] . "</font></td>";
} else {
echo "<td align='center' bgcolor='red'><font face='Arial'>" . $row1['quantity'] . "</font></td>";
}
echo "<td align='center'><font face='Arial'>" . $row1['location'] . "</font></td>";
echo "</tr>";
}
echo "</table>";
?>