title: select all checkboxes if none are select in php query
body: <p>I have a script wher users can find exercise from a database, I have checkboxes for the user to find specific exercises the script works fine when a least 1 checkbox is selected from each checkbox group however I would like it that if no checkboxes was selected then it would the results of all checkboxes.  </p>
  
  <p>my checkbox form looks like this       </p>
  
  <pre><code>    &lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post" name="criteria"&gt;
      &lt;p&gt;&lt;strong&gt;MUSCLE GROUP&lt;/strong&gt;&lt;/p&gt;
      &lt;input type="checkbox" name="muscle[]" id="abdominals" value="abdominals"/&gt;Abdominals&lt;br /&gt;
      &lt;input type="checkbox" name="muscle[]" id="biceps" value="biceps" /&gt;Biceps&lt;br /&gt;
      &lt;input type="checkbox" name="muscle[]" id="calves" value="calves" /&gt;Calves&lt;br /&gt;
       ect...
      &lt;br /&gt;&lt;p&gt;&lt;strong&gt;EQUIPMENT (please select a least one)&lt;/strong&gt;&lt;/p&gt;
      &lt;input type="checkbox" name="equipment[]" id="equipment" value="bands"/&gt;Bands&lt;br /&gt;
      &lt;input type="checkbox" name="equipment[]" id="equipment" value="barbell" /&gt;Barbell&lt;br /&gt;
      &lt;input type="checkbox" name="equipment[]" id="equipment" value="dumbbell" /&gt;Dumbbell&lt;br /&gt;
       ect....
      &lt;input type="submit" name="sub" value="Generate Query" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>and here is my script</p>
  
  <pre><code>     &lt;?php
  
        if(isset($_POST['muscle']) &amp;&amp; !empty($_POST['muscle'])){   
  if(isset($_POST['equipment']) &amp;&amp; !empty($_POST['equipment'])){   
  
  //get the function
   include ($_SERVER['DOCUMENT_ROOT'] .'/scripts/functions.php');    
   $page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
         $limit = 14;
         $startpoint = ($page * $limit) - $limit;
  
    // Runs mysql_real_escape_string() on every value encountered.
         $clean_muscle = array_map('mysql_real_escape_string', $_REQUEST['muscle']);
         $clean_equipment = array_map('mysql_real_escape_string', $_REQUEST['equipment']);
  
    // Convert the array into a string.
         $muscle = implode("','", $clean_muscle);
         $equipment = implode("','", $clean_equipment);
  
   $options = array();
         if(array($muscle))
         {
         $options[] = "muscle IN ('$muscle')";
         }
        if(array($equipment))
         {
        $options[] = "equipment IN ('$equipment')";
   }
  
  
        $fullsearch = implode(' AND ', $options);
  
        $statement = "mytable";
        if ($fullsearch &lt;&gt; '') {
        $statement .= " WHERE " . $fullsearch;
        }
  
       if(!$query=mysql_query("SELECT * FROM {$statement} LIMIT {$startpoint} , {$limit}"))
       {
       echo "Cannot parse query";
   }
   elseif(mysql_num_rows($query) == 0) {
   echo "No records found";
   }
  
  else {
  echo "";
  
  while($row = mysql_fetch_assoc($query)) {
  echo "".$row['name'] ."&lt;/br&gt;           
              ".$row['description'] ."";
          }
      }
           echo "&lt;div class=\"new-pagination\"&gt;";
          echo pagination($statement,$limit,$page);
          echo "&lt;/div&gt;";
          }
      }
  </code></pre>
  
  <p>Im new with php so my code may not be the best. If anyone can help me or point me in the right direction I would be very greatful.</p>