if you want to check for how long data has been in the database, use the time() directive and then subtract it from the time now. like $timenow=time();
if ($timenow > time already in mysql database +3600 (seconds)*time allowed to stay in database) {
delete/rename whatever
or use
$today = mktime(0,0,0,date("m"), date("d"),date("Y"));
this is the date, always unique for each day.