title: Posting result in mysql WHERE statement from form ($_GET) when no selection is made by a user
body: <p>Sorry if this has been asked before, I searched but couldn't find a suitable answer. There is probably a simple answer for this, but I'm stumped and hoping someone can provide a quick answer. I've got a form on my site where users can <em>filter</em> the data multiple ways. One <em>filtering</em> option in the the form is 'intensity' (low, medium, high). I'm using $_GET variables to post in the mysql WHERE statement. It works fine when an intensity option is chosen, but when the user does not choose an option I get no results output. What can I use as a value in the form that will end up outputting all intensities in the WHERE statement.</p>
  <p>Below are snippets of the code...</p>
  <pre><code>&lt;form action=&quot;workouts.php&quot; method=&quot;GET&quot; style=&quot;margin-top:5px&quot;&gt;
  &lt;small&gt;intensity&lt;/small&gt;
  &lt;select id=&quot;intensity&quot; name=&quot;intensity&quot;&gt; 
        &lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;/option&gt; 
        &lt;option value=&quot;low&quot;&gt;Low&lt;/option&gt; 
        &lt;option value=&quot;medium&quot;&gt;Medium&lt;/option&gt; 
        &lt;option value=&quot;high&quot;&gt;High&lt;/option&gt; 
        &lt;option value=&quot;auto&quot;&gt;Auto&lt;/option&gt; 
   &lt;/select&gt;
  &lt;small&gt; &lt;input type=&quot;submit&quot; value=&quot;go&quot; style=&quot;font-size:12px&quot;/&gt;&lt;/small&gt;
  &lt;/form&gt;
  
  &lt;?php  $intensity = $_GET['intensity']; ?&gt;
  
  
      
  </code></pre>
  <p>This is the WHERE statement I'm calling $intensity in...</p>
  <p>SELECT * FROM data WHERE <code>complete</code> = '1' and <code>intensity</code> = '$intensity' ORDER by <code>date</code> DESC</p>