Hi all,
I want to display the results in different color, after fetching the records. For example, if Status='Pending' display in red & if status= 'Closed' display in Green..
The following code, I am getting all displaying in Red. Pl help.
Rgds
Sridsam.
<?php
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","root","nandanam");
//select which database you want to edit
mysql_select_db("times");
//If cmd has not been initialized
if(!isset($cmd))
{
//display all the pending ids
$result = mysql_query("SELECT id,date,status,remarks FROM elog ORDER BY id");
//run the while loop that grabs all the pending IDs
while($r=mysql_fetch_array($result))
{
//grab the title and the ID of the news
{
echo "<tr>";
echo "<td align=center><a href='eedit.php?cmd=edit&id=$r[0]'>$r[0]</td>" ;
echo "<td align=center>$r[1]</td>";
echo "<td align=center bgcolor=red> $r[2]</td>";
echo "<td align=left>$r[3]</td>";
echo "</tr>";
}
}
}
?>