title: How do I ignore not setted arrays in MySQL-Statement by using multiselect value HTML
body: <p>How do I ignore empty values in MySQL-Statement? </p>
  
  <p>Like if e.g. the Manfacturer Name A and Name B are selected, Color Red is selected and the Price is ignored(value is empty).</p>
  
  <p>HTML-Part</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt;
    &lt;div class="container"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-xs-8"&gt;
          &lt;select multiple class="form-control" name="multiMan[]"&gt;
                  &lt;option value="" selected&gt; Manufacturer &lt;/option&gt; 
                  &lt;option value="A"&gt; Name A &lt;/option&gt; 
                  &lt;option value="B"&gt; Name B &lt;/option&gt; 
                  &lt;option value="C"&gt; Name C &lt;/option&gt; 
                &lt;/select&gt;
          &lt;br&gt;&lt;br&gt;
          &lt;select multiple class="form-control" name="multiCol[]"&gt;
                  &lt;option value="" selected&gt; Select color... &lt;/option&gt;
                  &lt;option value="red"&gt;    Red &lt;/option&gt;
                  &lt;option value="blue"&gt;   Blue &lt;/option&gt;
                  &lt;option value="green"&gt;  Green &lt;/option&gt;
                &lt;/select&gt;
          &lt;br&gt;&lt;br&gt;
          &lt;select multiple class="form-control" name="multiPri[]"&gt;
                  &lt;option value="" selected&gt; Price... &lt;/option&gt;
                  &lt;option value="100"&gt; 100 &lt;/option&gt;
                  &lt;option value="200"&gt; 200 &lt;/option&gt;
                  &lt;option value="300"&gt; 300 &lt;/option&gt;
                &lt;/select&gt;
          &lt;br&gt;&lt;br&gt;
          &lt;button type="submit" name="submit_filter" class="btn"&gt; GO &lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;center&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>PHP-Part</p>
  
  <pre><code>&lt;center&gt;
     &lt;?php
       if(isset($_POST["submit_filter"])){ 
        function splitArray($element){
          return "'$element'";
        }
  
        $array1         = $_POST['multiMan'];
        $searchMultiMan = implode(',', array_map('splitArray', $array1));
  
        $array2         = $_POST['multiCol'];
        $searchMultiCol = implode(',', array_map('splitArray', $array2));
  
        $array3         = $_POST['multiPri'];
        $searchMultiPri = implode(',', array_map('splitArray', $array3));
  
        echo $searchMultiMan . "&lt;br&gt;";
        echo $searchMultiCol . "&lt;br&gt;";
        echo $searchMultiPri . "&lt;br&gt;";
  
        $multiFilter =  "SELECT     data.manufacturer, data.color, data.price
                        FROM        data
                        WHERE       data.manufacturer IN ($searchMultiMan) 
                        AND         data.color        IN ($searchMultiCol)
                        AND         data.price        IN ($searchMultiPri);";
  
        echo $multiFilter;
  
        $multiFilterErg = mysqli_query($db, $multiFilter);    
       }
      ?&gt;
    &lt;/center&gt;
  </code></pre>
  
  <p>The problem here is, that the query is searching for a price with an empty entry.
  What I want to do is that if the price is not setted to ignore this and show all entries with Name A and B and color red and all prices. </p>