0) { $factor=ceil($timedif/$interval); $newtime=$oldtime+$factor*$interval; } else { $newtime=$oldtime+$interval; } /* Update the database with the new time */ mysql_query(" UPDATE notify SET date_field=FROM_UNIXTIME($newtime) WHERE id='$id'"); } } /* Query Database for passwd entries unused in last 90 days */ $result=mysql_query(" SELECT email FROM passwd WHERE esentpass+300000000<$curdate "); /* Delete accounts older than 90 days with no reminders pending */ while ($row=mysql_fetch_array($result)){ $email=$row['email']; $pending=mysql_query(" SELECT email FROM notify WHERE email='$email'"); $exist=mysql_fetch_array($pending); if (!$exist){ mysql_query(" DELETE FROM passwd WHERE email='$email'"); } } ?>