$cleanupDays=30; $query="DELETE FROM `mlg_acct` WHERE `acctstoptime` <= NOW() - INTERVAL ".$cleanupDays." DAY"; nr_query($query); $query="DELETE FROM `mlg_postauth` WHERE `authdate` <= NOW() - INTERVAL ".$cleanupDays." DAY"; nr_query($query);