It just so happens I was finishing something that does just what you ask. PROVIDED you use a timestamp in mySQL. This is working in PHP3:
function row_color($cnt,$even,$odd) {
print ($cnt%2) ? "<tr bg color=\"$odd\">" : "<tr bgcolor=\"$even\">";
}
echo "<hr><blockquote>\n<table cellspacing='2' cellpadding='2' width='90%'>\n";
echo "<tr>\n<th align='left'>Added or modified in the last 7 days(before today):</th>\n<th align='left'>Date added/modified:</th>\n</tr>\n";
mysql_connect("$DBHost","$DBUser","$DBPass") or die ("<br><b>The database server is temporarily down for maintenance...</b>");
$result=mysql("$DBName","SELECT address, urlID, entry_time FROM recURL WHERE TO_DAYS(NOW()) - TO_DAYS(entry_time) < 8");
$cnt=0;
while ($Nrow = mysql_fetch_row($result)) {
$Nurl=$Nrow[0];
$Nnum=$Nrow[1];
$Ntim=$Nrow[2];
$pieces=explode(":",$Ntim);
if ( ereg( "([0-9]{4})([0-9]{1,2})([0-9]{1,2})([0-9]{1,2})([0-9]{1,2})([0-9]{1,2})", $Ntim, $regs ) )
if ($Nnum != "") {
row_color($cnt++,"#F8F8F0","#FFFFFF");
echo "\n<td valign='top'>\n";
setlocale ("LC_TIME", "C");
$today = (strftime("%d"));
if ($regs[3] != $today)
echo "<img src=\"../images/ico_new.gif\"> <a href=\"$Nurl\" target=\"_blank\"><b>$Nurl</b></a></td>\n<td valign='top'>$regs[2]/$regs[3]/$regs[1] $regs[4]:$regs[5]:$regs[6]</td>\n</tr>";
}
}
echo "\n</table>\n";
By way of explanation, what this does is store the php function, strftime()in the var $today which is compared to the third regex from the timestamp explosion, then conditionally print the row results from the query in alternating row colors.