title: Checkbox Post Array Empty
body: <p>Can someone please help me figure out what is wrong with this array.  I've tried everything but it is always coming up empty in my post.  </p>
  
  <p>Greatly appreciated, Paul.</p>
  
  <p>FORM</p>
  
  <pre><code>while ($rowcat2 = mysql_fetch_array($resultcat2)) { 
          $accSubcatID = $rowcat2["id"];
          $accvalue = $rowcat2["value"];
  
      &lt;span&gt;&lt;?=$accvalue?&gt;:&lt;/span&gt;&lt;input type="checkbox" name="accSubcat[]" id="accSubcat[]" style="margin-right:10px;" value="&lt;?=$accSubcatID?&gt;" /&gt;
  
  }
  </code></pre>
  
  <p>POST DATA</p>
  
  <pre><code>  if(!empty($_POST['accSubcat'])){
  
      foreach($_POST['accSubcat'] as $key) {
  
          $accsubcatID = $key;
  
          if ($accsubcatID) {
  
      $sql3= "INSERT INTO yt_acc_data (busID,subcatID)
      VALUES ('$busID','$accsubcatID')";
      //Execute SQL statement
  
          if(!($mysql_rs3 = mysql_query($sql3)))
          die("Error in executing query3");
  
          }
      }
  
  }
  </code></pre>