How to save multiple checkbox (jquery and PHP)?
<p>I would like to save multiple checkbox(PHP and JQuery) in to MYSQL database.
Example table test there are 4 fields. Column A, NAME, C AND D.
After I clicked save it will be saved to those table;</p>

<p>Jqery code:</p>

<pre><code>$(document).ready(function(){           
 $("#btnsave").click(function(){
 var test = [];
   $("input[name='aa[]']:checked").each(function() {
    test.push($(this).val());
   });                    
   alert(test); 
    });
   });

function toggleCheckeda(status) {
$(".chkaa").each( function() {
$(this).attr("checked",status);
})          
}

function toggleCheckedb(status) {
$(".chkab").each( function() {
$(this).attr("checked",status);
})          
}

function toggleCheckedc(status) {
$(".chkac").each( function() {

$(this).attr("checked",status);
})          
}
</code></pre>

<p>PHP CODE:</p>

<pre><code>$db-&gt;Connect(); 
$stmt = $db-&gt;ExecData("select id,A,name,C,D from tbl_check");
&lt;form id="frm1" name="frm1"&gt;

    &lt;table&gt;    
        &lt;tr&gt;
         &lt;td&gt;
          &lt;input type="checkbox" value="" onclick="toggleCheckeda(this.checked)"&gt;
         &lt;/td&gt;
         &lt;td&gt;&lt;/td&gt;
         &lt;td&gt;
          &lt;input type="checkbox" value="" onclick="toggleCheckedb(this.checked)"&gt;
         &lt;/td&gt;
         &lt;td&gt;
          &lt;input type="checkbox" value="" onclick="toggleCheckedc(this.checked)"&gt;
         &lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;th&gt;
                A
            &lt;/th&gt;
            &lt;th&gt;
                Name
            &lt;/th&gt;
            &lt;th&gt;
                C
            &lt;/th&gt;
            &lt;th&gt;
                D
            &lt;/th&gt;
        &lt;/tr&gt;
        &lt;?php while ($row = $db-&gt;GetRow($stmt)){ ?&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;input type="checkbox" class="chkaa" name="aa[]" id="chk[]" value="a&lt;?php echo $row["id"]; ?&gt;" /&gt;
            &lt;/td&gt;
            &lt;td&gt;
               &lt;?php echo $row["name"]; ?&gt;
            &lt;/td&gt;
            &lt;td&gt;
           &lt;input type="checkbox" class="chkab"  name="cc[]" id="chk[]" value="c&lt;?php echo $row["id"]; ?&gt;" /&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;input type="checkbox" class="chkac"  name="dd[]"  id="chk[]" value="d&lt;?php echo $row["id"]; ?&gt;" /&gt;
            &lt;/td&gt;

        &lt;/tr&gt;
       &lt;?php } ?&gt;
    &lt;/table&gt;
   &lt;input type="button" id="btnsave" name="btnsave" value="save" /&gt;
 &lt;/form&gt;
</code></pre>
