title: Using a dropdown menu in a form for a SELECT statement with SQL
body: <p>Thank you for reading my question. </p>
  
  <p>I am building a form that will let users search a db for cards used in a collectible card game. I want to include a dropdown menu that will let users narrow their search down to a specific card expansion. </p>
  
  <p>Here is my dropdown menu:</p>
  
  <pre><code>&lt;select name="Expsn" onchange="this.submit()"&gt;
       &lt;option&gt;All Expansions&lt;/option&gt;
       &lt;option value="Core"&gt;Core&lt;/option&gt;
       &lt;option value="SoM"&gt;Shadows of Mirkwood&lt;/option&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here is the select statement:</p>
  
  <pre><code>$sql = "SELECT * FROM carddb 
  WHERE Expsn ='" . $_POST['Expsn'] . "' AND Type='Hero' ";
  </code></pre>
  
  <p>This works well when selecting either Core or MoR, but if the dropbox is left blank "All Expansions" is passed into the $_POST['Expsn']. (I use echo $sql; to output the SELECT statement). How can I set up the default to return card from all expansions.</p>
  
  <p>I have spent the last few weeks learning PHP and SQL online, so it is very possible that my whole approach here is VERY wrong and not scalable, so any 'big picture' help would be greatly appreciated. Thank you. </p>