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 '-20,20' at line 1 : select p.prop_auto_id, p.developer_auto_id, p.prop_title, p.franc_address, p.state_auto_id, p.city_auto_id, p.location_auto_id, p.prop_type_auto_id, p.furnished_auto_id, p.bedrooms, p.area, p.area_range, p.area_unit, p.prop_price, p.min_price, p.construction_age, p.prop_budget, p.prop_img_name, p.prop_img_thumb, p.location from properties as p LEFT JOIN developer as d ON p.developer_auto_id = d.user_auto_id LEFT JOIN tbl_background b ON b.prop_auto_id = p.prop_auto_id LEFT JOIN location as l ON p.location_auto_id = l.lid LEFT JOIN district as c ON p.city_auto_id = c.did where 1 and p.prop_status='Active' and p.location='noida' order by prop_auto_id desc limit -20,20