bobbybrown Posted July 5, 2009 Share Posted July 5, 2009 Hey guys, I've installed OScommerce to my site and got it all up and running, then found an error message. This is the error: 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 = '58' [TEP STOP] I get it when trying to search for something or when clicking on the categories for my products, meaning that noone can access my products! I've tried running querys in phpmyadmin but nothing works, I just get errors saying the fields don't exist. I don't have a field in the products table called products_d. I'm really confused why its happening, its a totally new fresh install of oscommerce. If someone can help me get this sorted it would be really appreciated, I've tried everything I can think of. Thanks for reading guys. Dan Quote Link to comment Share on other sites More sharing options...
fenway Posted July 5, 2009 Share Posted July 5, 2009 Sounds like someone upgraded to version 5 of mysql without telling you. JOIN and comma precedence changed -- you can't mix them anymore. Use this: select count(p.products_id) as total from products p on inner join products_to_categories p2c on ( p.products_id = p2c.products_id ) inner join products_description pd on (pd.products_id = p2c.products_id ) left join manufacturers m on ( p.manufacturers_id = m.manufacturers_id ) left join specials s on ( p.products_id = s.products_id ) where p.products_status = '1' and pd.language_id = '1' and p2c.categories_id = '58' Though you many need to switch LEFT and INNER depending on your needs. Quote Link to comment Share on other sites More sharing options...
bobbybrown Posted July 5, 2009 Author Share Posted July 5, 2009 Fenway, thanks for that I'll give it a try. Which file should I put that in? Thanks again. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 6, 2009 Share Posted July 6, 2009 File? No idea... wherever that query is being generated. Quote Link to comment Share on other sites More sharing options...
bobbybrown Posted July 6, 2009 Author Share Posted July 6, 2009 Just tried it again with 4 more templates I downloaded. Same error again! Take a look: http://girlynails.co.uk/shop/oscommerce-2.2rc2a/catalog/index.php 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 = '59' [TEP STOP] I'm really confused with this now, I've got until the weekend to get it done and thats only 4 full days. I have absolutely no idea where I'm going wrong :-\ Quote Link to comment Share on other sites More sharing options...
bobbybrown Posted July 6, 2009 Author Share Posted July 6, 2009 I've sorted it now. If anyone else has trouble with it get in touch with me. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 6, 2009 Share Posted July 6, 2009 I've sorted it now. If anyone else has trouble with it get in touch with me. Um... why not just post the solution? Quote Link to comment Share on other sites More sharing options...
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.