Ravensleach
Programmer
I'm trying to list an array and where the date field is less than 10 days ago, flag the record as "new".
Can anyone tell me why this isn't working?
Thanks for your help!
Can anyone tell me why this isn't working?
Code:
<?
$query = "SELECT date, name FROM tbl_onepagers WHERE fktheme = $id OR fktheme2 = $id OR fktheme3 = $id OR fktheme4 = $id OR fktheme5 = $id OR fktheme6 = $id";
$result = mysql_query($query) or die(mysql_error());
$date = mysql_query($query[date]);
$currentdate = DATE("Y-m-d");
// print list
echo "<ol>";
while($row = mysql_fetch_array($result)){
echo "<li><a href='#'>";
if ($date >= $currentdate - 10)
{
echo "<span class = 'new'>(New)</span> ";
}
echo $row['name'] . "</a></li>" ;
}
echo "</ol>";
?>
Thanks for your help!