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 'select IF(p2c.products_to_categories_attribs_id,p2ca.product' at line 1

select count(p.products_id) as total select IF(p2c.products_to_categories_attribs_id,p2ca.products_model,p.products_model) as products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, IF (p2c.products_to_categories_attribs_id,p2ca.attributes,p.products_id) as products_id, SUBSTRING_INDEX(pd.products_description,' ',20) as products_description, p.manufacturers_id, if (pa.products_id, pa.options_values_price + p.products_price, p.products_price) as products_price, 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, p.products_quantity as in_stock, if(s.status, 1,0) as is_special, p.products_sort_order, p.products_request_quote, p2ca.title_insert from products p left join specials s on p.products_id = s.products_id left join products_attributes pa on (p.products_id = pa.products_id and pa.attribute_default = 1), products_description pd, manufacturers m, products_to_categories p2c, products_to_categories_attrib p2ca where p.products_status = '1' and pd.products_id = p.products_id and p.products_id = p2c.products_id and pd.language_id = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '44' and p2c.categories_id != '999999999'

[TEP STOP]