title: Passing values to a query that may be null
body: <p>I'm trying to make a filter section for a website that will return objects from the DB. </p>
  
  <pre><code>SELECT *
  FROM users
  WHERE type = "1"
  AND age &lt; 50
  AND age &gt; 20
  </code></pre>
  
  <p>When entering this query, some users may not want to set a type, just filter it by age? Is there any sort of wild card i can pass into the query so it returns all if it not been defined by the user?</p>
  
  <p>The type can either be 1, 2 or 3. if this is not passed into it, i want it to return all users between the age of 20 and 50, and then all types?</p>