フィールド「ProspectStatus」の mysql 、RED、GREEN、YELLOWのテーブル/列から表示できる 3 つの値があります。
値に基づいてセルの背景色を変更する方法はありますか?
例えば
echo "<td>" . $row['ProspectStatus'] . "</td>";
PHP コード:
$result = mysql_query("SELECT * FROM customerdetails");
//List the Columns for the Report
echo "<table border='1'>
<tr>
<th>CustomerID</th>
<th>Customer Name</th>
<th>Prospect Status</th>
<th>Address</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['CustomerID'] . "</td>";
echo "<td>" . $row['CustomerName'] . "</td>";
echo "<td>" . $row['ProspectStatus'] . "</td>"; //this is the field I want to show either RED, GREEN or YELLOW
echo "<td>" . $row['Address'] . "</td>";
echo "</tr>";
}
echo "</table>";