Here's what you can do, provided that your date information is stored as a temporal data type in your MySQL table:
First, get the current UNIX timestamp, using the time() function:
$now = time();
When pulling the data from the database, MySQL provides a function called UNIX_TIMSTAMP(), which will convert any temporal data type to a UNIX timestamp. That oughtta take care of retrieving the temporal data in a fashion that can be dealt with by PHP... So your query would be something like:
"SELECT UNIX_TIMESTAMP(dt_created) FROM table WHERE yada yada yada..."
Since UNIX time is measured in seconds since Jan 1, 1970, and we know that there are exactly 86,400 seconds in a day, you could try something like:
if($mysql_dt_created < ($now = (86400 * 7))) {
// more than a week old code goes here
} else {
// less than a week old code goes here
}
Should work...