A Database Error Occurred

Error Number: 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 IF(T1.permanent_syn_to_website,1,T1.status!=1) AND T1.syn_to_website=1 GROU' at line 1

select T1.id,T1.width_foot,T1.width_inch,T1.import_id,T1.height_foot,T1.height_inch,T1.last_price,T1.old_rug_flag,T1.cost_piece,T1.cost_per_foot,T1.area,T1.regular_price,T1.discount_percentage,T1.m_product_name,T1.dealer_price from manzel_rugs as T1 left join rugs_categories as T3 on T3.rug_id=T1.id where T3.cat_id= AND IF(T1.permanent_syn_to_website,1,T1.status!=1) AND T1.syn_to_website=1 GROUP BY T1.id ORDER BY T1.id DESC Limit 0,15

Filename: /var/www/html/reclaimedshop.com/default/models/homemodel.php

Line Number: 606