title: Defining an SQL query from various input textboxes
body: <p>I wanted to know what would be considered "best practice" in terms of defining an SQL query based on input from various textboxes on a web page.</p>
  
  <p>Per say, lets say if you have 8 input textboxes on a website, would you be needing to use a bunch of if statements to evaluate what SQL query that you would end up using?</p>
  
  <p>ie.</p>
  
  <pre><code>var sql
  var a =  document.getElementByID('tb1').value
  var b =  document.getElementByID('tb2').value
  var c =  document.getElementByID('tb3').value
  var d =  document.getElementByID('tb4').value
  
  if (a.length &gt; 0 &amp;&amp; b.length &gt; 0 &amp;&amp; c.length &gt; 0 &amp;&amp; d.length &gt; 0) {
  
  sql = "SELECT * FROM table WHERE [firstname] = '"+a+"' AND [middlename] = '"+b+"' AND [lastname] = '"+c"' AND [organization] = '"+d+"'"
  
  }
  </code></pre>
  
  <p>ps. Im also using client-side Microsoft Jet, so no server or any sorts.</p>