Top Nav

osCommerce Upgrade MySQL from 4.1 to 5.0.x

There are several common problems in osCommerce with join syntax when upgrading MySQL from 4.1 to 5.0.x.

The exact fix for each join problem depends of the version of oscommerce being used and the patches or contributions that have been applied.

The general problem is that the comma operator precedence has changed so that list syntax joins can’t be mixed with explicit joins in the same way.

Where this worked previously:

It now needs to be:

We’ve identified the following files that frequently need to be updated:

catalog/index.php

There are four complex queries in this file that need to be updated as follows. The queries are shown in the order that they appear in the code.

PRODUCTS BY MFG + CATEGORY

Change from:

to:

PRODUCTS BY MFG

Change from:

to:

PRODUCTS BY CATEGORY + MFG

Change from:

to:

ALL PRODUCTS

Change from:

to:


catalog/advanced_search_result.php

The search query is formed by too much code to try and really sort out so the easy fix is to find this line:

and change it to:

Notice that the change is from p.products_id to pd.products_id in the specials table join condition.

catalog/admin/orders.php

From:

To:

From:

To: