Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

5 manufacturers per product mysql request error


buzuc

Recommended Posts

Posted

Hi everybody,

 

I've installed "manufacturer copy (how to)" contribution : working fine but I tried to modify the $listing_sql request to sort my products by manufacturer. I have 5 manufacturers available per product and I want to find products through the dropdown list "manufacturers".

 

Here is my modified request :

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.manufacturers3_id, p.manufacturers4_id, p.manufacturers5_id, p.products_price, p.products_tax_class_id, m.manufacturers_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 " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd LEFT JOIN " . TABLE_SPECIALS . " s ON p.products_id = s.products_id INNER JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id OR p.manufacturers2_id = m.manufacturers_id OR p.manufacturers3_id = m.manufacturers_id OR p.manufacturers4_id = m.manufacturers_id OR p.manufacturers5_id = m.manufacturers_id WHERE p.products_status = '1' AND pd.products_id = p.products_id AND pd.language_id = '" . (int)$languages_id . "' AND m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

 

and here is the message from the server :

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select p.products_image, pd.products_name, p.products_weight, 

select count(p.products_id) as total select p.products_image, pd.products_name, p.products_weight, p.products_id, p.manufacturers_id, p.manufacturers2_id, p.manufacturers3_id, p.manufacturers4_id, p.manufacturers5_id, p.products_price, p.products_tax_class_id, m.manufacturers_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 p, products_description pd LEFT JOIN specials s ON p.products_id = s.products_id INNER JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id OR p.manufacturers2_id = m.manufacturers_id OR p.manufacturers3_id = m.manufacturers_id OR p.manufacturers4_id = m.manufacturers_id OR p.manufacturers5_id = m.manufacturers_id WHERE p.products_status = '1' AND pd.products_id = p.products_id AND pd.language_id = '2' AND m.manufacturers_id = '22'

[TEP STOP]

my question is : from where does this "select count(p.products_id) as total " came from ?????

 

Thanks for the help!

MS2 2.2 fr + Manufacturer copy (5 manufacturers - modified to make it works) + More pics 6 + FCK Editor + zones shipping (modified without weight) + My contribution : Shopping Cart Management for Unique Products

 

I apologize in advance for my poor English I'm French !

Archived

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

×
×
  • Create New...