Q:

how can i Insert multiple checkboxes using PHP-jQuery and MSSQL Server?

I am trying to save a record in to MSSQL server  data base from multiple checkboxes using PHP-jQuery 

But this error appears.

The problem is in PHP code, how to read this string and record this data in MSSQL DB?
//PHP page: cat-grupos.php
    if(isset($_POST['buttonsave']))
    {  //echo "bttnsave"; // Mensaje Afirmativo.
                $vfpg   = $_POST['perGrupo'];
                $vfdg   = $_POST['depGrupo'];
                $vfsg   = $_POST['selGrado'];
                $vfchs  = $_POST['myCheckboxes']; // Array secciones A,B,C,..

                $query_in="INSERT INTO igrupos (idperiodo, idcarrera, grado, seccion)
                                               VALUES (?,?,?,?)";
            for ( $i=0; $i < count( $vfchs ); $i++ )
        {
            // do some stuff, save to database, etc.
             $params = array( 
                              array($vfpg   ,SQLSRV_PARAM_IN),
                              array($vfdg   ,SQLSRV_PARAM_IN),
                              array($vfsg   ,SQLSRV_PARAM_IN),
                              array($vfchs  ,SQLSRV_PARAM_IN)   

                             );
        }                                      

                $sql_in = sqlsrv_query($conn,$query_in,$params);
              if ($sql_in) // Se eejectuto la sentencia SQL?
               {
                 echo "SQLSuccess"; // Affirmative message.

                } else {
         $msgErrorSQL = "Error SQL not working"; // Negative Message;                     

                  die( print_r( sqlsrv_errors(), true)); // Causa del error.          
                        }
                 exit();
            }

Thanks a lot!
Here's the Ajax Code:
jQuery('#save').click(function(){

            <!--  VARIABLES del Formulario -->  
                      var vpGrupo   = jQuery('.modal-body #per-Grupo').val();
                      var vdGrupo   = jQuery('.modal-body #dep-Grupo').val();
                      var vsGrado   = jQuery('.modal-body #selGrado').val();

                     // var checkit   = jQuery('.modal-body #cbSeccion-list').val();
                     var data = { 'cbSeccion-list' : []};
                     // var myCheckboxes = new Array();
                       //    jQuery('.modal-body #cbSeccion-list input:checkbox:checked').each(function(){
                           jQuery("input:checkbox:checked").each(function(){
                                        data['cbSeccion-list'].push(jQuery(this).val());
                                    //  alert("Save clicked");
                                                                                            });
                        //console.log(data)
    alert("Save clicked ->> "+JSON.stringify(data));

                     //var myCheckboxes = jQuery('input:checkbox:checked').val();

            <!--  VARIABLES del Formulario -->
           jQuery.ajax({
                        url  : "cat-grupos.php",
                        type : "POST",//url:'buscar.php?act=insertar',
                      //async: false,
                        data : {
                                buttonsave   : 1,
                                perGrupo     : vpGrupo,
                                depGrupo     : vdGrupo,
                                selGrado     : vsGrado,
                                myCheckboxes : data // Array secciones A,B,C,..

                                },
                        success:function(result)
                               {

                                  if(jQuery.trim(result) === "SQLSuccess")
                                       {
                                   //  alert("Datos agregados correctamente");

                              alert(result);
                                         } else { 
                                        // alert(result);
                                        console.log(result)
                                 alert("Error SQL: "+result);
                                          }
                                },
                         error: function(XMLHttpRequest, textStatus, errorThrown)
                                 {
                          //error condition code
                          alert("Error AJAX not working: "+JSON.stringify(error));

                                    }       
                         }); 
               });

thanks and then replaced this PHP code:
if(isset($_POST['buttonsave']))
{  //echo "bttnsave"; // Mensaje Afirmativo.
            $vfpg   = $_POST['perGrupo'];
            $vfdg   = $_POST['depGrupo'];
            $vfsg   = $_POST['selGrado'];
            $vfchs  = $_POST['myCheckboxes']; // Array secciones A,B,C,..
            //$data = json_decode($vfchs, true);

        for ( $i=0; $i < count( $vfchs ); $i++ )
    {
        // do some stuff, save to database, etc.
         $query_in="INSERT INTO igrupos (idperiodo, idcarrera, grado, seccion)
                                           VALUES (?,?,?,?)";
         $params = array( 
                          array($vfpg   ,SQLSRV_PARAM_IN),
                          array($vfdg   ,SQLSRV_PARAM_IN),
                          array($vfsg   ,SQLSRV_PARAM_IN),
                          array($vfchs[$i]  ,SQLSRV_PARAM_IN),  

                         );
         $sql_in = sqlsrv_query($conn,$query_in,$params);
    }       

A:

I think you are sending the wrong data in your ajax.
Try this:
    jQuery.ajax({

       url  : "cat-grupos.php",
       type : "POST",//url:'buscar.php?act=insertar',
       //async: false,
       data : {              
                  buttonsave   : 1,
                  perGrupo     : vpGrupo,
                  depGrupo     : vdGrupo,
                  selGrado     : vsGrado,
                  myCheckboxes : data['cbSeccion-list'] // Array secciones A,B,C,..
       }, //rest of ajax

The difference being data['cbSeccion-list']

