PDA

View Full Version : Deleting files over 2 weeks old.


Josh
Mon 31st Jul '00, 9:34pm
I'm working on a script that will use a mySQL database to house the information. I have the script written and the database created, but need to find an easy way to remove entries that are over 2 weeks old.

What would be the easiest way to acheive this?

Thanks
~Josh

Bealers
Sat 5th Aug '00, 8:38pm
delete from table where date > some_date

Mike Sullivan
Sat 5th Aug '00, 9:19pm
I might be wrong, but shouldn't it be:

where date < some_date

??

Josh
Sun 6th Aug '00, 1:09am
Thanks guys...

I didn't even think of that method and the only other ones people suggested involved detailed calculations ;)

Thanks again,

~Josh

Bealers
Sun 6th Aug '00, 4:47am
yep <

NOT >

pesky keyboard ;)

Mike Sullivan
Sun 6th Aug '00, 12:16pm
Yes, damn things aren't telapathic :mad:

:D

Stallion
Wed 9th Aug '00, 6:25pm
I just hope there aren't any of those "slips" in Back-End! ;-)

Menno
Thu 10th Aug '00, 5:19am
Yeah, that would be a nice disaster :D

Bealers
Thu 10th Aug '00, 5:31am
...........

Tim Mousel
Fri 10th Nov '00, 6:44pm
$currenttime = time();

$sql = "DELETE FROM table WHERE expires < $currenttime";