in reply to Re: Deleting Old MySql Records With PERL
in thread Deleting Old MySql Records With PERL
Here's some actual code from the cgi.
#/usr/bin/perl -w use DBI; use CGI ':standard'; print "Content-type: text/html\n\n"; my $dbh = DBI->connect('dbi:mysql:my_db','searcher','searcherpasswd') 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';
Here are some error messages. The first is when using the 'Commented Out' piece of code. The others are when using the other piece of code.
Undefined subroutine &main::NOW called at e:\owner\website \cgi-bin\se +arch_ specialty.pl line 13 [Wed Jul 13 15:26:07 2016] [error] [client 72.208.178.63] String found + where operator expected at e:\owner\website \cgi-bin\search_ special +ty.pl line 14, near "interval '30days'" [Wed Jul 13 15:26:07 2016] [error] [client xx.xxx.xxx.xx] (Do you +need to predeclare interval?) 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.
According to advise from several tech sites the code should work. But, it doesn't.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Deleting Old MySql Records With PERL
by NetWallah (Canon) on Jul 13, 2016 at 22:15 UTC | |
by Milti (Beadle) on Jul 13, 2016 at 23:47 UTC | |
by NetWallah (Canon) on Jul 14, 2016 at 05:02 UTC | |
|
Re^3: Deleting Old MySQL Records
by hippo (Archbishop) on Jul 13, 2016 at 21:26 UTC |