I am trying to use php to form a web page that will print out data from my table. That is no problem. But I would also like it to identify items that are older than 5 days from the 'updated' field and have them displayed in red. Here is the code I have generated so far but, it doesn't work, of course. Keep in mind I have only been using php and mysql for a week so the code may look pretty sad.
$SQL = " SELECT id,issue_id,date_of_init,name,type,description,substring(request, 1, 100) as request,status,updated,days_outstanding,elevation_level,SUBSTRING_INDEX(additional_status, ';', 1) as additional_status FROM issues ORDER BY issue_id, updated desc ";
$retid = mysql_db_query($db, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
else {
$SQL2 = " SELECT updated from issues where to_days_(now()) - to_days(updated) >=5;
$ret = mysql_db_query($db, $SQL, $cid);
if (!$ret) {echo ("<P><D><table width=1250 border=1 cellspacing=0 cellpadding=0 align=left>\n");}
else {
echo ("<P><D><table width=1250 border=1 cellspacing=0 cellpadding=0 align=left bgcolor=#FF3333>\n");}
echo ("<TR>");
echo ("<td width=20 height=13><div align=center><font size=1>ID</font></div></td>\n");
echo ("<td width=52 height=13><div align=center><font size=1>Date of Initial</font></div></td> ");
echo ("<td width=86 height=13><div align=center><font size=1>Name</font></div></td> ");
echo ("<td width=20 height=13><div align=center><font size=1>Type</font></div></td> ");
echo ("<td width=200 height=13><div align=center><font size=1>Description</font></div></td> ");
echo ("<td width=235 height=13><div align=center><font size=1>Request</font></div></td> ");
echo ("<td width=35 height=13><div align=center><font size=1>Status</font></div></td> ");
echo ("<td width=52 height=13><div align=center><font size=1>Updated</font></div></td> ");
echo ("<td width=40 height=13><div align=center><font size=1>No. of Days Outstanding</font></div></td> ");
echo ("<td width=50 height=13><div align=center><font size=1>Elevation Level</font></div></td> ");
echo ("<td width=460 height=13><div align=center><font size=1>Additional Status</font></div></td> ");
echo ("</TR>");