Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete old ecards in mysql automatically..

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,I am kinda working on an e-card program.Everything's just fine...but I hope I could let those old ecards remain in MySQL (say those exceed 14 or 30 days) to be deleted automatically.Could anyone please help me figure out this?Thank you very much.
 
DELETE from ecard_table where created_date >= date_sub(curdate(), interval 14 day);

Enjoy.

//Karv ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
As far as automatic deletion goes, use KarveR's SQL statement and wrap it in a perl script. Then use cron to perform the deletion every night. ______________________________________________________________________
Did you know?
The quality of our answers is directly proportional to the number of stars you vote?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top