Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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.


In reply to Re^2: Deleting Old MySql Records With PERL by Milti
in thread Deleting Old MySql Records With PERL by Milti

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (6)
    As of 2019-05-22 06:59 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Do you enjoy 3D movies?



      Results (138 votes). Check out past polls.

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