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 ') and p.manufacturers_id<>10 and pd.products_description<>'' and WebPrice is not' at line 1

select distinct m.manufacturers_name, p.products_image, pd.products_name, pd.products_description, p.products_id, max(if(pi.saleprice>0,pi.saleprice, IF(s.status, s.specials_new_products_price, pi.WebPrice))) as final_price, sum(Available) as stock from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id left join inventory i on p.products_id=i.products_id left join posim_items pi on i.products_barcode=pi.ItemId , products_to_categories p2c where p.products_status = '1' and (Available>0) and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id in (87,140,141,198,22,84,166,79,212,213,80,211,210,81,149,208,209,214,82,199,91,88,90,89,92,145,128,132,147,,) and p.manufacturers_id<>10 and pd.products_description<>'' and WebPrice is not null group by m.manufacturers_name,p.products_image,pd.products_name,p.products_id,p.manufacturers_id

[TEP STOP]