July 20th, 2000, 04:55 PM
Join Date: Oct 1999
Location: Annapolis, Maryland US
Time spent in forums: < 1 sec
Reputation Power: 15
I'm making an assumption that you're using some flavor of UNIX, you have an account on the system, and the mysql table has some sort of date/timestamp field.
1) create a file called sqlexec containing the following:
mysql -u your_username -pyour_password
2) create a file called delete.sql containing the following:
delete from table_name where to_days(now())-to_days(date_field) > 14;
3)run it as a crontab:
# crontab -e
(insert into crontab file)
2 50 * * * /path/to/file/sqlexec<delete.sql
This will execute the script once a day at 2:50 AM
If the above assumptions weren't correct, then there are other ways, but that's the Q&D method for *NIX.