title: Building string based on combination of checked checkboxes
body: <p>On a form I have 3 checkboxes - <code>chk1</code>, <code>chk2</code>, &amp; <code>chk3</code>.</p>
  
  <p>The where clause of an SQL statement will be built, based on what combination of boxes are ticked.</p>
  
  <p>So, if only <code>chk1</code> is checked I need my string to be :-</p>
  
  <pre><code>where x=1
  </code></pre>
  
  <p>But if <code>chk1</code> and <code>chk2</code> are checked, I need my string to be :-</p>
  
  <pre><code>where x=1 or x=2
  </code></pre>
  
  <p>What is the best approach to build the string? I've tried nested ifs, but it seems very messy, and I'm sure there must be a better approach.</p>