
Originally Posted by
Ecniv
Two choices:
1) use Css
2) use inline font colors
Probably the second would be better.
HTML:
Code:
<font color='<number here>'>Words</font>
That is the most simplistic - you need to retrieve the number from the db (probably on a query/table loop) and write it to the page.
Thanks man i tried this and it gives me error. Also i do know what format should wirte so it takes value of color from db!!
i tried this and gives me syntax erro
echo("<tr><td><font color="#FF00FF">$Name</font></td>
furthermore i want to replace #FF00FF with value color from db but i do not know what format should i write it instead of color="????"
PHP Code:
<?
require("util.php");
$sql = new MySQL_class;
$sql->Create("color");
#
# Selecting Multiple Rows
#
echo("<html>");
echo("<head>");
echo("<p><ul><table border=1 cellpadding=4>\n");
echo("<tr><th>Name</th> > <th> color </th> </tr>\n");
$sql->Query("Select Name,color from NameColor");
for ($i = 0; $i < $sql->rows; $i++) {
$sql->Fetch($i);
$Name = $sql->data[0];
$color = $sql->data[1];
echo("<tr><td>$Name</td> <td>$color</td> \n");
#echo("<tr><td><font color="#FF00FF">$Name</font></td> <td>$color</td> \n"); ==> error here
}
echo("</table>\n");
echo("</body>");
echo("</html>");
?>