title: jqgrid json data array insert
body: <p>In jqgrid, the part checked in the checkbox is brought into an array and inserted into the DB through VO.</p>
  <p>I got the row data checked in jqgrid multiselect and pushed it into the declared array.</p>
  <pre><code>objGrid.click(function(){
  
              var data = objGrid.jqGrid('getGridParam','selarrrow');
              for(var i =0; i&lt;data.length; i++)
              {
  
                  empsl = objGrid.jqGrid('getCell', data[i], 'empno');
                  /* empsl = JSON.parse(empsl); */
                  arry.push(empsl);
              }
  
  
              test = JSON.parse(arry);
              //test = JSON.stringify(arry);
  
              console.log(test);
  
  
          });
  },
          
          buttons : {
              &quot;저장&quot;:function() {        
                  console.log(typeof arry);
                  console.log(&quot;insert data&quot;,arry);
                  
                   if (isRunning) {
                      alert($.message.common.notification.wait);
                      return;
                  }
                  isRunning = true; 
              
                      $.post(&quot;./CheckHoliday/addCheckHolidayData&quot;
                              , {empsl:arry} 
                              , function(data){
                                  if (data &gt; 0) {
                                      alert(&quot;has been saved.&quot;);
                                      closeDialogFunc();
                                      CheckHolidayListRefresh();
  </code></pre>
  <p>When I convert to JSON.stringify and press the save button, it comes in as an array well, but as you can see, even parentheses and quotation marks are entered as it is, and an error occurs.</p>
  <pre><code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[&quot;10010&quot;,&quot;10010&quot;,&quot;10049&quot;],
  'Y'
  )' at line 7
  </code></pre>
  <p>So, if you think you need to change it to JSON.parse(arry); and convert it to parse</p>
  <p>If only one data is selected in the checkbox, it will be saved successfully, but if more than one checkbox is selected,</p>
  <p>Uncaught SyntaxError: Unexpected token , in JSON at position 5 at JSON.parse () at HTMLTableElement.eval (eval at  (jquery-1.8.3.js:564), :102:17) at HTMLTableElement.dispatch (jquery-1.8.3.js:3058) at HTMLTableElement.eventHandle (jquery-1.8.3.js:2676)</p>
  <p>This error pops up in the developer tools console window, but I can't seem to put it into an array.</p>
  <p>The end goal is to put the selected data into an array.</p>
  <pre><code>INSERT INTO HRS_CHECKHOLIDAY (
  EMPNO
  , EMPSL
  , USEYN
  ) VALUES (
  ${empno},
  ${empsl},
  'Y'
  )
  </code></pre>