Hello,
I have a piece of code that pulls data from a mysql database. I am displaying the results in a table but want to format the background of certain cells based on the query results (ie red for no green for yes).
Here is my code:
$query = "SELECT
dis_risk_RecordCheck,
dis_risk_DisclosureForm
FROM cus_discipline_riskmgmnt";
$result = @mysql_query ($query); // Run the query.
echo "<table class=cards width=100% border=1><tr>
<td class=bluehdr>Record Check</center></td>
<td class=bluehdr>Disclosure Form</center></td>
</tr>";
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo "<tr>
<td class=cells>$row[1]</td>
<td class=cells>$row[2]</td>
</tr>";
}
echo "</table>";
In the above code I would like to have the row[2] results show a green background if the query result is yes and a red background if the result is no.
Any help is appreciated!
Thanks in advance!
ss