Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

don't know what to do


debsberk

Recommended Posts

Hi all. any help would be appreciated. I have a website www.papalovesmallory.com. certain links are not working and others give me responses like the following.

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '31'

 

[TEP STOP]

 

 

Believe me I am not computer skilled so any assistance rendered in plain ole English :) will be appreciated.

 

Thanks To All!!!

Link to comment
Share on other sites

I will guess that your server was recently upgraded to MySQL 5? It behaves differently for lists of tables to the left of a "join" statement.

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '31'

 

must be changed to

 

select count(p.products_id) as total from ((products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '31'

Link to comment
Share on other sites

I will guess that your server was recently upgraded to MySQL 5? It behaves differently for lists of tables to the left of a "join" statement.

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '31'

 

must be changed to

 

select count(p.products_id) as total from ((products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '31'

 

 

 

thanks for the help and information. My next question is WHAT has to be changed and HOW do I? do it? Like I said I am not very computer oriented. Willing to try anything to get the ste running properly. And yes I was just upgraded...

Link to comment
Share on other sites

thanks for the help and information. My next question is WHAT has to be changed and HOW do I? do it? Like I said I am not very computer oriented. Willing to try anything to get the ste running properly. And yes I was just upgraded...

Link to comment
Share on other sites

If you look at the code section I posted, you will see that any place you have a comma-separated list of tables, before a JOIN statement, you have to put parentheses around the list.

 

from products_description pd, products p left join

 

becomes

 

from (products_description pd, products p) left join

 

and so on, including (in this example), nested JOINs (thus the double (( before products_description).

 

The problem arises because of a change in precedence in MySQL 5 to bring it into compliance with SQL standards. Unfortunately this broke osCommerce code and there's no sign that the developers have any interest in fixing it. It would have been a simple (and backwards compatible) fix for RC2.2a, but it doesn't appear to have been done.

Link to comment
Share on other sites

The problem arises because of a change in precedence in MySQL 5 to bring it into compliance with SQL standards. Unfortunately this broke osCommerce code and there's no sign that the developers have any interest in fixing it. It would have been a simple (and backwards compatible) fix for RC2.2a, but it doesn't appear to have been done.

Excuse me? MySQL5 compatibility was added in the November 12, 2005 update of osC. Unfortunately, hosting providers seem often not to update the version of osC their customers can install automatically so the same error keeps coming back, and back, and back, and back, and back <_<

Link to comment
Share on other sites

  • 1 month later...

I've got osC 2.2 RC2a from osC's very own site, and it is not fixed for MySQL 5 (at least, not for the LEFT JOIN problem). Perhaps you're thinking of the many changes made for PHP 5 compatibility?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...