PaulBigwood Posted February 17 Posted February 17 Hi, Not sure whether this is is the right place for this query but would appreciate some assistance in solving it. Long story short, our website has run under OSCommerce 2.2-MS2 since 2005 with no problems. It was migrated by our developer (who is no longer with us) from another commercial site but with no e-commerce functionality. i.e no shopping card or prices shown. Recently the hosting server died and couldn't be restored. The hosting company moved the code to a new modern server but it doesn't run. I created a local LAMP server, installed PHP7.4, MYSQL 8 and installed our mycreated the MYSQL Database from a backup. I have the original OSCommerce code and installed on this server. I enabled error checking on the php code and after fixing a number of migration errors ( mysql_ to mysqli_ ) I now have this one. The osCommerce 2.2-MS2 is a debug echo added by me from inside /include/application_top.php. osCommerce 2.2-MS2Fatal error: Uncaught Error: Undefined constant "MYSQL_ASSOC" in /var/www/yaesunew/includes/functions/database.php:101 Stack trace: #0 /var/www/yaesunew/includes/application_top.php(85): tep_db_fetch_array() #1 /var/www/yaesunew/index.php(13): require('...') #2 {main} thrown in /var/www/yaesunew/includes/functions/database.php on line 101 Grepping MYSQL_ASSOC shows it being used in other code, but no definition. I tried to define it as a global in tep_db_query but that didn't work. We have a lot of information in our database and the layout and administrating the site works for us, so I'd rather try and get the code to run rather than have to recreate all the data on a new install, for which I know Quote
PaulBigwood Posted February 17 Author Posted February 17 Sorry posted before completed... .. recreate all the data on a new install, for which I know e-commerce and pricing is a requirement. Any help pointers appreciated. Paul Bigwood Quote
Jack_mcs Posted February 17 Posted February 17 5 hours ago, PaulBigwood said: Uncaught Error: Undefined constant "MYSQL_ASSOC" It's because you are using mysqli and that is not defined in the engine. There are various ways to fix it depending on the code. Probably replacing the code with the function mysqli_fetch_assoc is the best one. Upgrading MS2 code to work with mysqli and, more importantly, php 7, is not a simple process. You will probably run into quite a few more failures, if they have not been fixed yet. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
PaulBigwood Posted February 19 Author Posted February 19 Thanks Jack_mcs, I have come to the conclusion that its just too difficult and probably easier to start again with a different website engine. Thanks again. Best Regards Paul Bigwood Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.