I'm now using this code. Still getting an error message.
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";
$sth = $dbh->prepare ("DELETE FROM my table where DATE <UNIX_TIMESTAMP
+(DATE_SUB(NOW()-INTERVAL 30 DAY)");
$sth->execute ();
Error message ----
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at e:\owner\cgi-bin\search_specialty.pl line 14.
Line 14 is $sth->execute ();