title: Multiple checkbox selection (filter) for products
body: <p>What I'm trying to do is to make a filter for products, I'm retrieving products from the database including an image and some information, and I want some filters like:  PRODUCT and BRAND</p>
  
  <p>I have this code but when  I select two filters like  brand 1 + product 2 that shows me all products of brand 1 and all products number 2.. and I want it combined...</p>
  
  <p>Here's my code:</p>
  
  <p>HTML+PHP</p>
  
  <pre><code>&lt;div id="row" class="row"&gt;
  
  &lt;?php
  
  if(!empty($_GET["category"])){
    include('open_conexion.php');
    $sql = "SELECT * FROM products WHERE category='".$_GET["category"]."'";
  
    $result = mysql_query($sql);
  
    while ($row = mysql_fetch_array($result)) {
  
    ?&gt;
  
    &lt;div class="col-lg-4"  data-category="&lt;?php echo $row['product'];?&gt;" brand="&lt;?php echo $row['brand'];?&gt;" &gt;
        &lt;img  class="img-circle" src='images/&lt;?php echo $row['imag']; ?&gt;'  width="180px;" height="180px;"alt=""&gt;
        &lt;h4&gt;&lt;?php echo $row['product']." ". $row['brand']; ?&gt;&lt;/h4&gt;
        &lt;p&gt;&lt;?php echo $row['description'];?&gt; &lt;/p&gt;
        &lt;p&gt;&lt;a class="btn btn-default" href='detalles.php?id=&lt;?php echo $row['id_product']?&gt;'&gt;View Details &amp;raquo;&lt;/a&gt;&lt;/p&gt;
  
  &lt;/div&gt;&lt;!-- /.col-lg-4 --&gt;
  
  
  
    &lt;?php } } ?&gt;
  
  
    &lt;/div&gt;&lt;!-- /.row --&gt;
  </code></pre>
  
  <p>and the jQuery:</p>
  
  <pre><code> &lt;script&gt;
  $('input[type="checkbox"]').click(function() {
  if ($('input[type="checkbox"]:checked').length &gt; 0) {
      $('.row &gt;div').hide();
  
  
      $('input[type="checkbox"]:checked').each(function() {
          $('.row &gt;div[data-category=' + this.value + ']').show();
          $('.row &gt;div[brand=' + this.value + ']' ).show();
  
      });
  } else {
      $('.row &gt;div').show();
  
  
  }
  });
  </code></pre>
  
  <p></p>
  
  <p>Thanks</p>