Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Urgent Help with this code


juniorprg

Recommended Posts

Posted

Hi there,

In the "New Products for <month> I need to show only i product information, so i made a small change in modules/new_products, im not used to php so i did a small tweak and dint work, this is the error msg:

 

Column: 'products_id' in where clause is ambiguous

 

select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id where products_id = '39' order by p.products_date_added desc limit 9

 

 

The real code was this

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status= '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

I changed the product_status ='1' to product_id="39"

 

Can anyone please help with this code, as this is very urgent...

 

thanks

l8ter

Posted
In the real code

TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status= '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

Change to

TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = '42' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

I got the answer...:-)

l8ter

Archived

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

×
×
  • Create New...