Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Deleting Old MySql Records With PERL

by Milti (Sexton)
on Jul 13, 2016 at 21:00 UTC ( #1167731=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #/usr/bin/perl -w
    use DBI; 
    use CGI ':standard'; 
    ...
    or die "Connection Error: $DBI::errstr\n";
    ##DELETE FROM my table WHERE DATE(NOW(), date) >30;
    DELETE FROM my table where now()-d >interval '30days';
    
  2. or download this
    Undefined subroutine &main::NOW called at e:\owner\website \cgi-bin\se
    +arch_ specialty.pl line 13
    
    ...
    Syntax error at e:\owner\website \cgi-bin\search_ specialty.pl line 14
    +, near ")-d "
    
    Execution of e:\pinnacle\website\cgi-bin\search_specialty.pl aborted d
    +ue to compilation errors.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1167731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2019-05-24 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (151 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!