title: Conditional clauses using Codeigniter's Active Record
body: <p>I have a function returning data based on the parameters passed. 
  Basically, the queries change depending on the clauses. </p>
  
  <pre><code>if(1==$case) 
  return select()-&gt;from('db')-&gt;where('x',$something)-&gt;where('y','fixed')...
  
  else if(2==$case)
  return select()-&gt;from('db')-&gt;where('x','fixed')-&gt;where('y',$something)...
  </code></pre>
  
  <p>Is there a better way of doing this? </p>
  
  <p>Also, is it possible to have such a  clause</p>
  
  <pre><code>...-&gt;where('category',*)
  </code></pre>
  
  <p>'*' to be replaced by a value or something which equates to "any".  </p>