Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need help with this SQL


keithschm

Recommended Posts

$listing_sql = "select p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price 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 = '$current_category_id' order by pd.products_name limit 3";

 

 

Since my host switched to PHP 5 this query does not work and I get the "1054 - Unknown column 'p.products_id' in 'on clause'"

 

I was able to fix most sections of the site but this query.

 

any help would be appreacated

 

Thanks

Link to comment
Share on other sites

$listing_sql = "select p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price 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 = '$current_category_id' order by pd.products_name limit 3";

Since my host switched to PHP 5 this query does not work and I get the "1054 - Unknown column 'p.products_id' in 'on clause'"

 

I was able to fix most sections of the site but this query.

 

any help would be appreacated

 

Thanks

See if this helps:

http://www.oscommerce.com/community/contributions,4654

Link to comment
Share on other sites

Thanks I had allready done that, but this query is a little differnt, and I can not figure out how to fix it

Keith,

 

See my post HERE.

 

It shows how I managed to make the update work on all products page.

I believe you can alter this query the same way.

 

Notice the "(" at the end of the third line and the ")" in the middle of the 6th line.

 

I honestly do not know what that does, but I ciphered out that change from the index.php change.

 

Tim

Link to comment
Share on other sites

Keith,

 

See my post HERE.

 

It shows how I managed to make the update work on all products page.

I believe you can alter this query the same way.

 

Notice the "(" at the end of the third line and the ")" in the middle of the 6th line.

 

I honestly do not know what that does, but I ciphered out that change from the index.php change.

 

Tim

 

 

worked like a charm

 

Thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...