Howdy,
Ok I have created a mySQL table to hold clients urls and renewal dates.
What I am wanting to do is when the date of renewal is within 1 month of the present date, to change the font colour of that cell to Red.
Hope that makes sence!
Code so far:
[code=php]<?php
$host=”127.0.0.1″; $username=”username”; $password=”password”; $db_name=”db_name”; $tbl_name=”Hosting”;
mysql_connect(“$host”, “$username”, “$password”)or die(“cannot connect”);
mysql_select_db(“$db_name”)or die(“cannot select DB”);
$result = mysql_query(“SELECT * FROM Hosting ORDER BY Renewal”)
or die(mysql_error());
echo “<table border=’1px’><tr>”;
for($i = 0; $i < mysql_num_fields($result); $i++){
echo “<th>”.mysql_field_name($result, $i).”</th>”;
}
echo “</tr>”;
while($row = mysql_fetch_array($result)){
echo “<tr>”;
for($i = 0; $i < mysql_num_fields($result); $i++){
echo “<td>”. $row[$i] .”</td>”;
}
echo “</tr>”;
}
echo “</table>”;
?>
So far I have it to order the table so the next Renewal date is at the top of the table.
Any help wud be great, Thanks.