All

I have a website written in Perl and operating out of cgi-bin. It has been up and running fine for the past 10 years. My site is an auction for commercial fishermen that allows them to buy and sell quota (fishery management). Sales data has been transferred into a MYSQL database.

This past weekend the folks that run the server told me that my version of Cpanel need to be updated, but the new version would not run on the server that I was on, so they would migrate me to another server. So I got migrated. The new server runs a newer version of PHP (version 7.X) and MYSQL.

And now I receive an error message when sales are attempting to be added to the database. The Error message occurs at the "execute" command.

Here is the relevant section of code:

##### prepare and execute query my $query = "INSERT INTO closedauctions (seller, sellerusername, categ +ory, title, bids, pounds, description, winningbid, price_per_pound, h +ighbidder, buyerusername, month, day, year, itemnum, filename) VALUES +(\"$sellername\",\"$sellerusername\",\"$quota\", \"$category\", 1, \" +$pounds\", \"$desc\", \"$buyit\", \"$price_per_pound\", \"$buyername\ +",\"$buyerusername\", \"$month\", \"$day\", \"$year\", \"$form{'ITEM' +}\", \"$cat\")"; my $sth = $dbh->prepare($query) || die "Could not prepare SQL statemen +t ... maybe invalid?"; $sth->execute() || die "Could not execute SQL statement ... maybe inva +lid?"; ##### disconnect from database $dbh->disconnect;

Is this old Perl and not compatible with the newer version of MYSQL?

All worked well prior to the migration.

Pete


In reply to Insert into mysql database by NorCal12

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, details, 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, summary, 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.