Everything has been working perfectly for years, then decided to upgrade PHP.
Prior PHP v. 5.2.28
Upgraded to PHP v. 5.5 - site completely broken
Downgraded to PHP v. 5.3.29 (unable to downgrade all the way back to 5.2.28)
For the `products_id` VALUE in the INSERT use NULL or 0. That will cause the auto-increment value to be used.
$HTTP_POST_VARS should be changed to $_POST before you move to a newer version of PHP. $HTTP_POST_VARS is deprecated and is expected to be removed in the future. http://php.net/manual/en/reserved.variables.post.php
Can you tell me from the code I posted where I would need to make changes? I'm not a coder so I need some hand holding. :)
Dave Baldwin
While I think @jimyX gave you code for the insert, you will likely need to hire a coder to update all of your code to the newer standards. I believe this will go way beyond hand-holding.
I'm a little concerned about this -- if the script is inserting a constant value into the AUTO_INCREMENT id field, it would have been failing years ago. It may be that your test data set has changed or there are other changes that are not apparent to us here. In any case, you're on the right track to hire a professional to help you remediate and upgrade. There are a lot of things that can go wrong and some of them have dire consequences, so don't take any chances with important data. Back up everything now.
Many of the E-E experts have a "hire me" button on their profiles.
You might want to seriously consider starting over with net-new code. PHP has come a long way since this was written, and whoever wrote this did not do you any "favors." At first glance, it looks like something that is untestable. Like an old car that breaks down -- it may make more sense to get a new car than try to find all the parts and keep repairing things as they break. Today it would not cost very much to use an ORM framework like Laravel to rebuild the back-end. A Laravel expert would be expected to have a high hourly rate and very high hourly output.
Going forward, PHP has a change log that you can refer to when you get ready to do upgrades. All of the compatibility issues are well-documented. It's a lot to read, but it's require reading for anyone who depends on PHP. http://php.net/ChangeLog-5.php
Best of luck with your project, ~Ray
gr8gonzo
That code looks a lot like osCommerce. If it is, are you working with a customization / add-on for it and what version of it are you on?
$HTTP_POST_VARS should be changed to $_POST before you move to a newer version of PHP. $HTTP_POST_VARS is deprecated and is expected to be removed in the future.
http://php.net/manual/en/reserved.variables.post.php