Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


dan@swift

Recommended Posts

All right, I've seen many other instances of this, believe me, I've searched so please bear with me. My problem stems from Dreamhost changing me from mysql4 to mysql5. I've gone through the other threads, and made many changes, but I'm still getting this

 

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

 

select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from (products p) left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join featured f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id in (1118) and p.products_status = '1' and f.status = '1' order by rand() DESC limit 6

 

 

So far I've corrected the following files:

 

catalog/index.php

catalog/advanced_search_result.php

catalog/includes/modules/new_products.php

catalog/includes/modules/featured.php

 

I'm pretty sure there were a few more files that I went through, looking for the from and join, and adding the ( ) where needed. My home page looks great, and the actual product pages look correct, and the orders are still coming in correctly, but if I click on a catagory, the page formatting is gone, it's just a white background with the sub-catagory's displayed, and I get to the end of the subcatagorys, I just get a blank page with the error.

swiftmotorsports.com is the site if looking will help.

Dan

Link to comment
Share on other sites

You failed to add another pair of parentheses. And, you have an unnecessary pair.

 

select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat,
s.specials_new_products_price, p.products_price from (products p left join specials s on p.products_id = s.products_id, 
products_to_categories p2c, categories c) left join featured f on p.products_id = f.products_id where p.products_id =
p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id in (1118) and p.products_status = '1' and 
f.status = '1' order by rand() DESC limit 6

 

Read http://www.oscommerce.com/forums/topic/335136-osc-and-mysql-5-1054-errors to understand what's going on.

Link to comment
Share on other sites

How do I figure out which file this is? Will one of these .php files have a spot that looks pretty much exactly like this? Believe me, I've read that thread many times, but so far I'm reading, but perhaps not completly understanding what's going on. Can you point out the lack of ( ) and the extra ( )? I hate to be such a burden, but I am really lost right now, as I'm just learning this setup. I do appreciate your assistance much, I think that I'm close, just not quite there yet.

Dan

Link to comment
Share on other sites

select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from (products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c) left join featured f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id in (1118) and p.products_status = '1' and f.status = '1' order by rand() DESC limit 6

It appears to be a slightly modified (or older) version of includes/modules/new_products.php. Did you add some sort of "featured products" add-on? Leave the ( before TABLE_PRODUCTS . " p, remove the ) after " p, add ) before left join.

Link to comment
Share on other sites

All right, I'm getting closer!! The catagory will work again, and the sub-catagories are useable, until I get to the final product page, and it's doing the same thing. I'm also getting a stack of n at the top of the page, but I'll continue these changes and see what happens.

 

BTW, it does have a featured.php too, and the site uses the sts templates. I just want this done so I can get back out to the shop where I belong!

Link to comment
Share on other sites

First of all, thank-you Mr. Phil for your patience. I kind of see what's going on, and it seems that I have the error messages gone, the catagory's are working all the way through to the individual product pages. The only thing that I'm getting now that's new is a stack of n on the catagory pages, different amounts on different pages. Here's one example http://www.swiftmotorsports.com/index.php?cPath=1408_1409

 

Any ideas?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...