title: multiple checkbox filtering php
body: <p>I am filtering the results from the database using checkboxes and it works fine with one checkbox however when I check multiple checkboxes it returns the rows only for the first checkbox. How can I have it to filter the results with multiple checkboxes?</p>
  
  <p>Here are the checkboxes</p>
  
  <pre><code> &lt;form id="form" method="post" action=""&gt;
  &lt;input type="checkbox" name="football" class="checkbox" &lt;?=(isset($_POST['football'])?' checked':'')?&gt;/&gt; Football&lt;br&gt;
  &lt;input type="checkbox" name="basketball" class="checkbox" &lt;?=(isset($_POST['basketball'])?' checked':'')?&gt;/&gt; Basketball&lt;br&gt;
  &lt;input type="checkbox" name="volleyball" class="checkbox" &lt;?=(isset($_POST['volleyball'])?' checked':'')?&gt;/&gt; Volley Ball&lt;br&gt;
   &lt;/form&gt;
  
   &lt;script type="text/javascript"&gt;  
      $(function(){
       $('.checkbox').on('change',function(){
          $('#form').submit();
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>here is the select query.. the third <code>else if</code> statement returns only the first checkbox value which is basketball</p>
  
  <pre><code>if (isset($_POST["football"])){
    $paginate = new pagination($page, "SELECT * FROM balls where type LIKE '%foot%' ORDER BY id desc", $options);
   }
  
  else if (isset($_POST["basketball"])){
    $paginate = new pagination($page, "SELECT * FROM balls where type LIKE '%bask%'   ORDER BY id desc", $options);
   }
  
  else if (isset($_POST["volleyball"])){
    $paginate = new pagination($page, "SELECT * FROM balls where type LIKE '%vol%'  ORDER BY id desc", $options);
   }
  
  else if (isset($_POST["basketball"]) &amp;&amp; isset($_POST["football"]) &amp;&amp; isset($_POST["volleyball"])){
    $paginate = new pagination($page, "SELECT * FROM balls where type LIKE '%bask%' or type LIKE '%foot%' or type LIKE '%vol%' ORDER BY id desc", $options);
   }
  
  else { $paginate = new pagination($page, 'SELECT * FROM balls ORDER BY id desc', $options);
  
  }
  </code></pre>