title: Datatable select filter
body: <p>I'm trying to create custom filters for my datatable using <code>&lt;select&gt;</code>.</p>
  
  <p>How can I make for when someone selects one of the options, the datatable display the items according to the selection without having to refresh the page? <br></p>
  
  <p>DATATABLE CODE:</p>
  
  <pre><code> $(document).ready(function() {
        $('#datatable').DataTable({
          "pagingType": "full_numbers",
          "lengthMenu": [
            [10, 25, 50, -1],
            [10, 25, 50, "Todas"]
          ],
          responsive: true,
          language: {
            search: "_INPUT_",
            searchPlaceholder: "Filtro", //Ignorem isso
          }
  
  
        });
  
        var table = $('#datatable').DataTable();
  
      });
  </code></pre>
  
  <p>how can I also do so that several options of the same value are not created?</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;select class="form-control" placeholder="pais" name="pais"&gt;
  &lt;option selected &gt;PAÍS&lt;/option&gt;
  &lt;?php foreach ($resultado as $row) { ?&gt;
  &lt;option value="&lt;?=$row['pais']?&gt;"&gt; &lt;?php echo $row['pais']; ?&gt;&lt;/option&gt;
  &lt;?php } ?&gt;
  &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>&lt;select class="form-control" placeholder="pais" name="pais"&gt;
  &lt;option selected &gt;PAÍS&lt;/option&gt;
  &lt;option value="BRAZIL"&gt; BRAZIL&lt;/option&gt;
  &lt;option value="BRAZIL"&gt; BRAZIL&lt;/option&gt;
  &lt;option value="BRAZIL"&gt; BRAZIL&lt;/option&gt;
  &lt;option value="BRAZIL"&gt; BRAZIL&lt;/option&gt;
  &lt;option value="BRAZIL"&gt; BRAZIL&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I select "BRAZIL", the datatable list all items with the country "BRAZIL".</p>
  
  <p>More codes:</p>
  
  <pre><code>&lt;?php
  //error_reporting(0);
  require_once("ct.php");
  session_start();
  
  $resultado = array(); 
  $query = "SELECT * FROM infh";
  $result = mysqli_query($connect, $query); 
  $resultado = $result-&gt;fetch_all(MYSQLI_ASSOC);
  
  
  
  
  &lt;table id="datatable" class="table table-striped table-bordered" cellspacing="0" width="100%"&gt;
                    &lt;thead&gt;
                       &lt;tr&gt;
                          &lt;th style="display:none;"&gt;ID&lt;/th&gt;
                          &lt;th&gt;BIN&lt;/th&gt;                         
                          &lt;th&gt;BANDEIRA&lt;/th&gt;
                          &lt;th&gt;LEVEL&lt;/th&gt;
                          &lt;th&gt;BANCO&lt;/th&gt;                                             
                          &lt;th&gt;PAÍS&lt;/th&gt;
  
                       &lt;/tr&gt;
                    &lt;/thead&gt;
                    &lt;tfoot&gt;
                       &lt;tr&gt;
                          &lt;th style="display:none;"&gt;ID&lt;/th&gt;
                          &lt;th&gt;BIN&lt;/th&gt;
                          &lt;th&gt;BANDEIRA&lt;/th&gt;
                          &lt;th&gt;LEVEL&lt;/th&gt;
                          &lt;th&gt;BANCO&lt;/th&gt;
                          &lt;th&gt;PAÍS&lt;/th&gt;
  
                       &lt;/tr&gt;
                    &lt;/tfoot&gt;
                    &lt;tbody&gt;
                      &lt;?php foreach ($resultado as $row) { ?&gt;
                       &lt;tr&gt;
                          &lt;td style="display:none;" class="id_&lt;?=$row['id']?&gt;"&gt;&lt;?php echo $row['id']; ?&gt;&lt;/td&gt;
                          &lt;td class="seis_&lt;?=$row['id']?&gt;"&gt;&lt;?php echo substr($row['pr'],0,6); ?&gt;&lt;/td&gt;
                          &lt;td class="bandeira_&lt;?=$row['id']?&gt;"&gt;&lt;?php echo $row['bandeira']; ?&gt;&lt;/td&gt;
                          &lt;td class="level_&lt;?=$row['id']?&gt;"&gt;&lt;?php echo $row['level']; ?&gt;&lt;/td&gt;
                          &lt;td class="banco_&lt;?=$row['id']?&gt;"&gt;&lt;?php echo $row['banco']; ?&gt;&lt;/td&gt;
                          &lt;td class="pais_&lt;?=$row['id']?&gt;"&gt;&lt;?php echo $row['pais']; ?&gt;&lt;/td&gt;
  
                       &lt;/tr&gt;
                       &lt;?php } ?&gt;
                    &lt;/tbody&gt;
                 &lt;/table&gt;
  </code></pre>