title: pdo php multiple queries with select menu
body: <p>I made populated selectmenu's to make queries to my sql database. The first option-tags of all select menu's have <code>value=""</code> Now everything works fine when I'm using 2 selectmenu's. But If I want to use more (in my case 48) it becomes rather complex. Is there an easier way?</p>
  
  <p>examples of both pages:</p>
  
  <pre><code> &lt;select name="titel" id="titel" value=""&gt;
   &lt;option value=""&gt;Selecteer&lt;/option&gt;
   &lt;?php
   if($rowCount &gt; 0){
      while($row = $query-&gt;fetch_assoc()){ 
          echo '&lt;option  value="'.$row['titel'].'"&gt;'.$row['titel'].'&lt;/option&gt;';
      }
   }else{
      echo '&lt;option value=""&gt;Language not available&lt;/option&gt;';
   }
   ?&gt;
   &lt;/select&gt;
  </code></pre>
  
  <p>2nd page:</p>
  
  <p>loginscript etc:</p>
  
  <pre><code>$sql = "SELECT DISTINCT * FROM Library";
  
  if( (isset($_POST['titel']) &amp;&amp; $_POST['titel'] != '') ) {    
  $sql .= " where titel =:titel";
  
  if ( (isset($_POST['version']) &amp;&amp; $_POST['version'] != '') ) {    
  $sql .= " AND version =:version"; 
     }    
   } 
  
  if ( (isset($_POST['version']) &amp;&amp; $_POST['version'] != '') &amp;&amp; !   (isset($_POST['titel']) &amp;&amp; $_POST['titel'] != '') ) {    
  $sql .= " where version =:version"; 
   }
  
  $query = $pdo-&gt;prepare($sql);    
  
   if( (isset($_POST['titel']) &amp;&amp; $_POST['titel'] != '') ) {
   $query-&gt;bindParam(':titel', $_POST['titel']);
   }
  
   if( (isset($_POST['version']) &amp;&amp; $_POST['version'] != '') ) {
   $query-&gt;bindParam(':version', $_POST['version']);
   }
  
   $query-&gt;execute();
  </code></pre>