Here's some actual code from the cgi.
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 188.8.131.52] 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.