Milti has asked for the wisdom of the Perl Monks concerning the following question:
I have a MySql database with a table(s) containing dated records. I use a PERL cgi to allow visitors to my site to search the database according to various parameters and then output a results list. That works fine. However at the beginning of the program I want to open the database and delete records that are older than 30 days in the target table. I've tried every piece of code from every tutorial that I can find on the Internet such as DELETE FROM table WHERE DATE (NOW (), date) >30 or DELETE FROM table WHERE DATE < DATE_SUB(NOW(), INTERVAL 30 DAY) and many others. NONE work. I continually get some kind of error message.
Can anyone help?
Thanks in advance for any guidance that is provided!
|
|---|