
May 5th, 2000, 04:38 PM
|
|
Apprentice Deity
|
|
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237

Time spent in forums: 4 m 8 sec
Reputation Power: 17
|
|
|
The best way to do this is to use MySQLs built in date functions. If you've stored the date in any of the mysql time formats you can do this in your query:
select other,fields,you,want,to_days(now())-to_days(date_field) as age from table where whatever
Then in your php you can add a simple line:
if ($row[age]<=30)
{
print "NEW!"; // or image or whatever
}
|