SELECT n.*, r.*, f.nid, f.field_thumb_fid, p.fid, p.filepath, pt.nid, z.nid, z.field_zone_value, aa.nid, aa.field_address_value, pt.field_proptype_value, sf.nid, sf.field_sqft_value, sqft.nid, sqft.field_minsqft_value, sqft.field_maxsqft_value FROM node AS n , node_revisions AS r, content_field_thumb AS f, content_field_proptype AS pt, content_field_zone AS z, content_field_sqft AS sf, content_field_address AS aa, content_type_prprtylstng AS sqft, files AS p WHERE field_proptype_value = "Office" AND z.nid = n.nid AND sf.nid = n.nid AND pt.nid = n.nid AND r.nid = n.nid AND sqft.nid = n.nid AND sqft.field_minsqft_value >= AND sqft.field_maxsqft_value <= AND f.nid = n.nid AND aa.nid = n.nid AND p.fid = f.field_thumb_fid AND n.status = "1" UNION SELECT n.*, r.*, f.nid, f.field_thumb_fid, p.fid, p.filepath, pt.nid, z.nid, z.field_zone_value, aa.nid, aa.field_address_value, pt.field_proptype_value, sf.nid, sf.field_sqft_value, sqft.nid, sqft.field_minsqft_value, sqft.field_maxsqft_value FROM node AS n , node_revisions AS r, content_field_thumb AS f, content_field_proptype AS pt, content_field_zone AS z, content_field_sqft AS sf, content_field_address AS aa, content_type_prprtylstng AS sqft, files AS p WHERE field_proptype_value = "Office" AND z.nid = n.nid AND sf.nid = n.nid AND pt.nid = n.nid AND r.nid = n.nid AND sqft.nid = n.nid AND sqft.field_minsqft_value <= AND sqft.field_maxsqft_value >= AND f.nid = n.nid AND aa.nid = n.nid AND p.fid = f.field_thumb_fid AND n.status = "1"
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 sqft.field_maxsqft_value <= AND f.nid = n.nid AND aa.nid = n.nid ' at line 33