NorCal12 has asked for the wisdom of the Perl Monks concerning the following question:
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Insert into mysql database
by hippo (Archbishop) on Mar 02, 2021 at 22:58 UTC | |
by LanX (Saint) on Mar 02, 2021 at 23:26 UTC | |
Re: Insert into mysql database
by Tux (Canon) on Mar 03, 2021 at 07:44 UTC | |
Re: Insert into mysql database
by NorCal12 (Novice) on Mar 03, 2021 at 00:11 UTC | |
by Radiola (Monk) on Mar 03, 2021 at 02:02 UTC | |
by LanX (Saint) on Mar 03, 2021 at 00:28 UTC | |
Re: Insert into mysql database
by Anonymous Monk on Mar 03, 2021 at 04:13 UTC |