Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


VioletCrownSoap

Recommended Posts

Posted

What a mess. I had to update, and everything is out of whack. I get this on all my products, classes, etc. full text of error is

 

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 = '24'

 

with p2c.categories_id=xx for each category

 

all is well over on the admin side...

Posted

Discussed many times before. http://www.oscommerce.com/forums/topic/335136-osc-and-mysql-5-1054-errors

 

You need to add () around comma-separated lists of tables on the left side of JOINs. The query you gave becomes

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 = '24'

Archived

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

×
×
  • Create New...