Originally posted by greg252
I assume that you mean After the submit.
Yes, you can, and you answered the question yourself. Use an if conditional or a switch to change the color:
if ($PDMA_field=="P"){
$bgcolor="red";
}
etc...
echo"
<tr bgcolor=$bgcolor><td>$PDMA_field</td></tr>";
I tried but I think I have to add "else" somewhere as I need 3 or 4 different colors
this is the code I'm using in a different table...
<HTML>
<?php
$db = mysql_connect("fr**.be", "", "pwd");
mysql_select_db("mbo",$db);
$result = mysql_query("SELECT FROM personnel",$db);
echo "<TABLE>";
echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>";
while($myrow = mysql_fetch_array($result))
{
echo "<TR><TD>";
echo $myrow["firstname"];
echo " ";
echo $myrow["lastname"];
echo "<TD>";
echo $myrow["nick"];
echo "<TD>";
echo $myrow["salary"];
}
echo "</TABLE>";
?>
</HTML>
in this code I need that the SALARY row will become RED if under a certain salary and green if over a certain salary staying black in between.... and becoming say blu when over another amount....
😃
still possible ???