I use this on one of my sites to check if the user is activated within 3 days (72Hours) if not they get deleted.
<?php
$sql = "SELECT * FROM tbltime";
$result = mysql_query($sql);
while($row_rstime = mysql_fetch_array($result)){
$activated = $row_rstime['active'];
$when = strtotime($row_rstime['date_joined']); // "2007-05-24 20:50:53"
if ($activated == 'Y' || time() < ($when+60*60*24*3)) {
echo 'Whatever'<br>';
}else{
//Get the date and hour, 72 hours ago
$minus = strtotime("-72 hours");
$date = date("Y-m-d H:i:s", $minus);
$query = "Do something here if needed";
$delete = mysql_query($query);
echo 'Whatever'<br>';
}
}
?>
Hope this will help you get an idea?
Otherwise search php.net for date and time functions.
Cheers
West