1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' s.minimum_qty, NULL) as specials_new_products_price, IF(s.status, s.specials...' at line 1
select p.products_model, p.products_quantity, p.products_image, pd.products_name, p.products_id, p.products_call_us, p.products_quantity, p.products_last_modified, tr.tax_rate, c.zap_categories_status, p.products_zap_status, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description, p.manufacturers_id, p.products_free_shipping, p.products_price, p.products_tax_class_id, cu.value, IF(s.status, s.specials_new_products_price, s.expires_date, s.minimum_qty, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, s.status as specials_status from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c left join categories c on p2c.categories_id = c.categories_id, tax_rates tr, products_description pd, manufacturers m, currencies cu where pd.products_id = p2c.products_id and p.products_tax_class_id = tr.tax_class_id and c.categories_status = '1' and p.products_status = '1' and pd.products_id = p.products_id and p.products_price_currency_code = cu.code and pd.language_id = '2' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '219' order by (final_price*(1+tr.tax_rate/100)/cu.value) , pd.products_name, (p.products_price=0),p.products_call_us=1 limit 0, 120