SELECT distinct p.products_image, p.products_model, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_unit_price, p.products_pack_quantity, p.products_model, 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 p, products_description pd left join specials s on p.products_id = s.products_id inner join models_to_parts mod on p.products_model=mod.part WHERE p.products_status = '1' AND pd.products_id = p.products_id AND pd.language_id = '1' AND (mod.model = '47-0826-3XX') error is: ERROR 1064 (42000): 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 'mod on p.products_model=mod.part where p.products_status = '1' and pd.products_i' at line 1