#/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'; #### Undefined subroutine &main::NOW called at e:\owner\website \cgi-bin\search_ 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_ specialty.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 due to compilation errors.