Building SQL from multiple combinations of query parameters
Instead of dynamic string concatenation, you can do a logic trick. I'm going to use named sql placeholders for clarity. You'll obviously need to implement the code, I'm just giving you the idea.

select a
     , b
     , c
  from someTbl
 where (:PMaxAge  is null or maxAge &lt;= :PMaxAge)
   and (:PMinRent is null or rent   &gt;= :PMinRent)
   and (:PMaxRent is null or rent   &lt;= :PMaxRent)
   -- etc ...


You may need to check for an empty string instead of checking for null to detect when a param was omitted depending on you implementation, but you get the point - let each criteria be satisfied if the param is missing.