title: Update multiple checkbox in codeigniter
body: <p>I'm new in codeigniter. I'm developing student Information project. There is one form with multiple check box that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/LvQJX.png" alt=""></p>
  
  <p>So first the inserted values are put inside the checkbox. The value is checked first but when I select another set of values, only the last value is updated.</p>
  
  <p>I want to update multiple checkbox.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>MY Code</strong></p>
  
  <p>Controller:delete.php</p>
  
  <pre><code>&lt;?php
  class delete extends CI_Controller
  {
    function __construct()
      {
              parent::__construct();
  
              $this-&gt;load-&gt;helper('url');
              $this-&gt;load-&gt;helper('form');
              $this-&gt;load-&gt;helper('html');
              $this-&gt;load-&gt;model("delete_model");
              $this-&gt;load-&gt;library("pagination");
              //$this-&gt;load-&gt;library('table');
      }
  
     function GetAll()
    {
          $this-&gt;load-&gt;model('delete_model'); 
          $data['query']=$this-&gt;delete_model-&gt;GetAll();
          $this-&gt;load-&gt;view('studentview_view',$data);
    }
  
     //Get Record By Id
    function getstudbyid($id)
      {
      $this-&gt;load-&gt;model("delete_model"); 
      $data['student']=$this-&gt;delete_model-&gt;getstuddetailsbyid($id);
      //echo $this-&gt;db-&gt;last_query();
      $this-&gt;load-&gt;view("displayview",$data);
      }
  
  
    //pagination
  
     function test($start_from = 1)
  {
  
      $this-&gt;load-&gt;model('delete_model'); 
      $this-&gt;load-&gt;library('pagination');
      // $data['query']=$this-&gt;delete_model-&gt;GetAll();
      $data = array();
  
      $per_page = 3;
      $this-&gt;load-&gt;model('delete_model');
  
      $total = $this-&gt;delete_model-&gt;record_count();
       $start = $per_page * ($start_from-1);
  
      $data['student'] = $this-&gt;delete_model-&gt;get($per_page, $start);
  
      $config['base_url'] = base_url() . "index.php/delete/test";
      $config['total_rows'] = $total;
      $config['per_page'] = $per_page;
      $config['uri_segment'] = 2;
      $config['num_links'] = 2;
      $config['use_page_numbers'] = TRUE;
         //$config['overwrite'] = TRUE;
  
  
      $this-&gt;pagination-&gt;initialize($config); 
  
  
      $data['pagination'] = $this-&gt;pagination-&gt;create_links();
  
  
  
  
          foreach($data['student'] as $key=&gt;$value){
          //echo $key;
  
          foreach($value as $k=&gt;$v)
          {
  
  
           if ( $k == 'id') {
  
                  anchor('delete/del'.$v,'delete');
                  anchor('delete/input/'.$v,'Edit');
  
                  }
          }}  
              // $data['table'] = $this-&gt;table-&gt;generate();
               $this-&gt;load-&gt;view('studentlist' ,$data);
  }
  
  
    //Delete Record
  
    function del($id){
  
      $this-&gt;load-&gt;helper('html');    
      $this-&gt;load-&gt;model('delete_model');
  
      if((int)$id &gt; 0){
        $this-&gt;delete_model-&gt;delete($id);
  
      }
  
      $data = $this-&gt;delete_model-&gt;delete();
  
      $data['student'] = $this-&gt;delete_model-&gt;delete();
  
            redirect($_SERVER['HTTP_REFERER']);  
            //$this-&gt;load-&gt;view('studentlist',$data);    
    }
  
    //Update Record
  
    function input($id=0)
    {
      $this-&gt;load-&gt;model('delete_model');
  
  
      if($this-&gt;input-&gt;post('btnupdate'))
      {
          if($this-&gt;input-&gt;post('id'))
          {
          $this-&gt;delete_model-&gt;entry_update();
          echo $this-&gt;db-&gt;last_query();
          }
      else
          {
          $this-&gt;student_model-&gt;student();
          }
      }
  
      $data = $this-&gt;delete_model-&gt;student_data();
  
  
      if((int)$id &gt; 0)
      {
      $query = $this-&gt;delete_model-&gt;getstuddetailsbyid($id);
      print_r($query);
      //echo $this-&gt;db-&gt;last_query();
       // $data['fid']['value'] = $query['id'];
       // $data['up_std_name']['value'] =$query['std_name'];
       // $data['up_std_address']['value']=$query['std_address'];
       // $data['stud_class']['value']=$query['std_class'];
       // $data['up_std_language']['value']=$query['std_language'];
  
       $data['fid'] = $query['id'];
       $data['up_std_name']=$query['std_name'];
       $data['up_std_address']=$query['std_address'];
       $data['stud_class']=$query['std_class'];
  
  
  
  
       $data['up_std_language']=$query['std_language'];
        $data['up_std_gender'] =$query['std_gender'];
       echo "--------";
  
          //print_r($data);
          echo "----bhumika----";
          //print_r($query['std_languag']);
      print_r($data['up_std_language']);
          echo "---a---";
          echo "&lt;br/&gt;";
          echo "&lt;br/&gt;";
  
  
  
  
  
  
  
        // if($query['std_gender']=='F')
        // {
          // $data['up_std_gender']['checked'] = TRUE;
  
          // }
          // else
          // {
  
            // $data['up_std_gender']['checked'] = FALSE;  
          // }
  
  
      // $data['up_std_birthdate']['value']=$query['std_birthdate'];
       // $data['up_std_photo']['value']=$query['std_photo'];
       // $data['up_std_ilanguage']['value']=$query['std_int_language'];
       // print_r($data['up_std_ilanguage']['value']);
  
       $data['up_std_birthdate']=$query['std_birthdate'];
       $data['up_std_photo']=$query['std_photo'];
       $data['up_std_ilanguage']=$query['std_int_language'];
      // print_r($data['up_std_ilanguage']);
      }
      $this-&gt;load-&gt;view('finalview',$data);   
    }
  
  
  }
  
    ?&gt;
  </code></pre>
  
  <p>Model:delete_model.php</p>
  
  <pre><code>&lt;?php
      class delete_model extends CI_Model{
  
        function stud_delete_model()
        {
          parent::CI_Model();
  
        }
  
        //View Record
        public function GetAll()
          {
          $this-&gt;load-&gt;database();
          $query=$this-&gt;db-&gt;get('student');
          return $query-&gt;result();
          }
  
        //paging
         public function record_count() {
              $this-&gt;load-&gt;database();
           $this-&gt;db-&gt;count_all("student");
          // echo $this-&gt;db-&gt;last_query();
              return $this-&gt;db-&gt;count_all("student");
          }
  
  
          function get($limit,$start_from)
          {
           $this-&gt;load-&gt;database();
           $sql = "SELECT * FROM student LIMIT $start_from, $limit";
  
              $query = $this-&gt;db-&gt;query($sql);
           //  echo $this-&gt;db-&gt;last_query();
              return $query-&gt;result_array();
          }
            //view Record by id
            public function getstuddetailsbyid($id)
              {
              $this-&gt;load-&gt;database();
              $query=$this-&gt;db-&gt;get_where('student',array('id'=&gt;$id));
              //$this-&gt;db-&gt;last_query();
              return $query-&gt;row_array();
              }
  
  
          //Delete Record
  
           function delete($id)
           {
          $this-&gt;load-&gt;database();
          $this-&gt;db-&gt;where('id',$id);
  
          $this-&gt;db-&gt;delete('student'); 
  
  
  
        }
  
        //Update Record
  
        function entry_update()
        {
        $this-&gt;load-&gt;database();
        $date=$this-&gt;input-&gt;post('datepicker');
  
  
  
        $data=array(
        'std_name'=&gt;$this-&gt;input-&gt;post('std_name1'),
        'std_address'=&gt;$this-&gt;input-&gt;post('std_address1'),
        'std_class'=&gt;$this-&gt;input-&gt;post('std_class'),
        'std_language'=&gt;$this-&gt;input-&gt;post('std_language1'),
        'std_gender'=&gt;$this-&gt;input-&gt;post('std_gender1'),
        'std_birthdate'=&gt;date('Y-m-d', strtotime(str_replace('-', '/', $date))),
        'std_photo'=&gt;$this-&gt;input-&gt;post('userfile'),
        'std_int_language'=&gt;$this-&gt;input-&gt;post('std_ilanguage1')
        );
       //$t=$this-&gt;input-&gt;post('std_language1');
          //      echo "***";
              //  echo $t;
              //print_r($t);
  
                   // if(isset($this-&gt;input-&gt;post['std_language1']))
                   // {
                   // $q=implode(',',$this-&gt;input-&gt;post['std_language1'] );
                   // echo "(((((";
                   // print_r($q);
                  //$data['q']=$q;
                  //print_r($data);
                  // }
                  // else
                  // {
                  // $q='';
                  // }
                  // echo $q;
  
  
         print_r($data);
  
        $this-&gt;db-&gt;where('id',$this-&gt;input-&gt;post('id'));
        $this-&gt;db-&gt;update('student',$data);
        }
  
  
       function student_data()
       {
       //Label of form
      // $data=array();
       //$data['fid']      =array();
      //$data['stud_class']   = '';
       //$data['up_std_name'] = array();
       //$data['up_std_address']=array();
  
        $data['fid']      ='';
  
       $data['up_std_name']   = '';
       $data['up_std_address']='';
       $data['stud_class']   = '';
        $data['up_std_language']='';
        $data['up_std_gender']='';
        $data['up_std_birthdate']='';
        $data['up_std_photo']='';
       //echo "ddddddd";
      // print_r($data['up_std_address']);
  
  
       //$data['std_name1']="Name";
       //$data['std_address1']="Address";
       //$data['std_class']="Class";
       // $data['up_std_class_list']=array(
                              // 'select' =&gt; 'Select',
                              // '10th'  =&gt; '10th',
                              // '12th'    =&gt; '12th',
                              // 'Graduate'   =&gt; 'Graduate'
  
                              // );
  
       //$data['std_language1']="Language";
       //$data['std_gender1']="Gender";
       //$data['std_birthdate']="Birthdate";
       //$data['std_photo']="Photo";
       //$dat['std_int_language']="Interested Language";
  
       //values get from the database
       //$data['fid']['value'] = 0;
       //print_r($data['fid']['value']);
       // $data['up_std_name'] = array(
                    // 'name'        =&gt; 'std_name',
                    // 'id'          =&gt; 'std_name',
                   // 'maxlength'   =&gt; '50',
                    // 'size'        =&gt; '30',
                    // 'style'       =&gt; 'width:30%'
                  // );
  
  
      // $data['up_std_address']=array(
                              // 'name'=&gt;'std_address',
                              // 'id'=&gt;'std_address',
                              // 'rows'=&gt;'2',
                              // 'columns'=&gt;'5',
                              // 'width'=&gt;'20',
                              // 'size'=&gt;'50',
                              // 'maxlength'   =&gt; '100',
                              // 'style'=&gt;'width:30%'
      // );
  
  
  
      // $data['up_std_language']=
                                  // array('name'=&gt;'std_language',
                                      // 'value'=&gt;'.Net',
                                      // 'checked'=&gt;True
  
                                  // );
                                  // (array('name'=&gt;'std_language',
                                      // 'value'=&gt;'PHP',
                                      // 'checked'=&gt;false
                                  // )
                                  // );
                                  // (array('name'=&gt;'std_language',
                                      // 'value'=&gt;'JAVA',
                                      // 'checked'=&gt;false
                                  // )
                                  // );
                                  // (array('name'=&gt;'std_language',
                                      // 'value'=&gt;'Android',
                                      // 'checked'=&gt;false
                                  // )
                                  // );
                                  // (array('name'=&gt;'std_language',
                                      // 'value'=&gt;'Iphone',
                                      // 'checked'=&gt;false
                                  // )
                                  // );
                                  //print_r($data['up_std_language']);
  
      // $data['up_std_gender']=(array
                                  // (
                                  // "name"=&gt;"std_gender",
                                  // "id"=&gt;"std_gender",
                                  // "value"=&gt;"M", 
                                  // 'checked'=&gt;set_radio('std_gender', 'M', True)
                                  // )
                                  // );
                                  // ?&gt;
  
                                   &lt;?php 
                                  // (array
                                  // (
                                  // "name"=&gt;"std_gender",
                                  // "id"=&gt;"std_gender",
                                  // "value"=&gt;"F", 
                                  // 'checked'=&gt;set_radio('std_gender', 'F', True)
                                  // )
                                  // );
                                  ?&gt;
  
      &lt;?php // $data['up_std_birthdate']=''; ?&gt;
                                   &lt;td&gt;
  
                     &lt;/td&gt;
  
  
  
  
                      &lt;?php       
  
      //$data['up_std_photo']=''; 
  
  
  
  
  
  
      // $data['up_std_ilanguage']=array(
                        // 'select' =&gt; 'Select',
                        // '.Net'  =&gt; '.Net',
                        // 'PHP'    =&gt; 'PHP',
                        // 'JAVA'   =&gt; 'JAVA',
                        // 'Android'=&gt; 'Android',
                        // 'IPhone'   =&gt; 'IPhone'
                      // );
  
              ?&gt;              
  
  
  
  
                          &lt;?Php   return $data;   
  
       }
  
  
  
  
  
  
  
      }
      ?&gt;
  </code></pre>
  
  <p>View:finalview.php</p>
  
  <pre><code>&lt;?php
      //echo validation_errors();
  
      ?&gt;
  
      &lt;html lang="en"&gt;
      &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css"&gt;
      &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
      &lt;script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt;
      &lt;script&gt;
      $(function() {
      $( "#datepicker" ).datepicker();
        dateFormat: 'yyyy-mm-dd'
        onclick="javascript: ('datepicker','yyyyMMdd','arrow',true,'12',true)" 
      });
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;? echo form_open('delete/input');
      //print_r($fid);    ?&gt;
          &lt;? echo form_hidden('id',$fid); ?&gt;
  
      &lt;table&gt;
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_name'&gt;Student Name&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
      &lt;?php
      $data = array(
                    'name'        =&gt; 'std_name1',
                    'id'          =&gt; 'std_name1',
                    'maxlength'   =&gt; '100',
                    'size'        =&gt; '50',
                    //'value'     =&gt; set_value('std_name1'),
                    'style'       =&gt; 'width:50%'
                  );
  
      //echo form_input('std_name1',set_value('std_name1'));
      echo form_input('std_name1',$up_std_name);
      //print_r($up_std_name);
      //echo $std_name1;
      //print_r($std_name1);
      ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_address'&gt;Address&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
      &lt;?php
      $data=array(
      'name'=&gt;'std_address1',
      'id'=&gt;'std_address1',
      'rows'=&gt;'3',
      'columns'=&gt;'3',
      'size'=&gt;'50',
       'maxlength'   =&gt; '100',
      'style'=&gt;'width:50%'
      );
  
      echo form_textarea('std_address1',$up_std_address);
      print_r($up_std_address);
      ?&gt;
  
      &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_class'&gt;Class&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
      &lt;?php
      $options = array(
                      'select' =&gt; 'Select',
                        '10th'  =&gt; '10th',
                        '12th'    =&gt; '12th',
                        'Graduate'   =&gt; 'Graduate'
  
                      );
                      echo form_dropdown('std_class',$options,$stud_class);
                      print_r($stud_class);
                      ?&gt;&lt;/td&gt;
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_language'&gt;Language&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
      &lt;?php
  
  
  
              // $query['']=array('.Net'=&gt;'.Net','PHP'=&gt;'PHP');
              // print_r($query);
              //echo "----charmi---";
          //  print_r($up_std_language);
          //  print_r($data['up_std_language']['value']);
  
                //    print_r($language);
               //echo "bbb";
               //echo "&lt;br/&gt;";
  
              //echo set_checkbox(in_array('std_language', $language) // TRUE checks the box, FALSE does no
              // );
                $language = explode(',',$up_std_language); 
  
  
  
  
  
  
  
                  $a='';
                  $b='';
                  $c='';
                  $d='';
                  $e='';
  
  
  
           //print_r($t);
           // if(isset ($this-&gt;input-&gt;post['std_language1'])) {
                  // $role = implode(',', $this-&gt;input-&gt;post('std_language1'));  
                  // print_r($role);
                  // } else {
                  // $role = '';
                  // }
  
  
                  if(in_array('.Net',$language))
                  {
                  $a='checked="checked"';
                  //echo $a;
                  }
                  if(in_array('PHP',$language))
                  {
                  $b='checked="checked"';
                  //echo $b;
                  }
                  if(in_array('JAVA',$language))
                  {
                  $c='checked="checked"';
                  }   
                  if(in_array('Android',$language))
                  {
                  $d='checked="checked"';
                  }
                  if(in_array('IPhone',$language))
                  {
                  $e='checked="checked"';
                  }
                      // $skill = implode(',', $this-&gt;input-&gt;post('skill'));
                       //$data['skill'] = $skill;
  
  
  
  
                 echo form_checkbox('std_language1','.Net',$a). ".Net";
                echo form_checkbox('std_language1','PHP',$b)."PHP";
                 echo form_checkbox('std_language1','JAVA',$c)."JAVA";
                  echo form_checkbox('std_language1','Android',$d)."Android";
                   echo form_checkbox('std_language1','IPhone',$e)."IPhone";
  
                  $t=$this-&gt;input-&gt;post('std_language1';
                  echo "***";
                  echo $t;
              //print_r($t);
                   //print_r($language);
                   $v=$language;
                   print_r ($v);
                   if(isset($t))
                   {
                   $q=implode(',',$this-&gt;input-&gt;post['std_language1'] );
                   echo "(((((";
                   print_r($q);
                  //$data['q']=$q;
                  //print_r($data);
                   }
                  // else
                  // {
                  // $q='';
                  // }
                  // echo $q;
  
  
  
                ?&gt;
  
  
  
  
      &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_gender'&gt;Gender&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
      &lt;?php
      //echo $gender=$this-&gt;input-&gt;post('std_gender1');
      // if($gender=='male' || empty($gender)) $mchecked=true;
          // else if($gender=='female') $fchecked=true;
  
          // if($gender=="male")
          // {
          // echo "checked";
          // }
  
             // echo form_radio('std_gender1', 'male', @$mchecked, 'id=male').form_label('Male', 'male'); 
          // echo  form_radio('std_gender1', 'female', @$fchecked, 'id=female').form_label('Female','female'); 
  
          //print_r($up_std_gender);
           // $checked = '';          
           // if($checked)
           // {
           // $checked='F';
          //echo $checked;
          //$false='M';
           // }
           // else
           // {
           // $checked='M';
          //$false='F';
           // }
      // echo form_radio('std_gender1', 'M', $checked)."Male";
      // echo form_radio('std_gender1', 'F', $checked)."Female";
  
  
          $gender=array(
                  'name'=&gt;'std_gender1',
                  'id'=&gt;'std_gender1'
                  //'checked'=&gt;set_value('std_gender1', 'F', FALSE)
                  );
                  echo "=======";
          print_r($up_std_gender);
          // $checked = '';   
      $w='M'; 
      $m='F';
            if($up_std_gender)
            {
           $w='checked="checked"';
           }
          else 
      if($up_std_gender)
           {
           $m='checked="checked"';
           }
  
  
          //echo $checked;
          // $false='M';
           // }
           // else
           // {
           // $checked='M';
          // $false='F';
           // }
          echo form_radio('std_gender1', 'M',$w)."Male";
          echo form_radio('std_gender1', 'F',$m)."Female";
  
          // echo form_radio($gender,$up_std_gender,set_value('std_gender1', 'F', TRUE))."Male";
          // echo form_radio($gender,'F',set_value('std_gender1', 'M', TRUE))."Female";
               // echo form_radio(array
                                  // (
                                  // "name"=&gt;"std_gender1",
                                  // "id"=&gt;"std_gender1",
                                  // "value"=&gt;"F", 
                                  // 'checked'=&gt;set_value('std_gender1', 'F', FALSE)
                                  // )
                                  // );
      // ?&gt;
  
      &lt;?php 
              // echo form_radio(array
                                  // (
                                  // "name"=&gt;"std_gender1",
                                  // "id"=&gt;"std_gender1",
                                  // "value"=&gt;"M", 
                                  // 'checked'=&gt;set_value('std_gender1', 'M', FALSE)
                                  // )
                                  // );
      ?&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
      &lt;td valign="top"&gt;
      &lt;label for='std_birthdate'&gt;Birthdate&lt;/label&gt;
      &lt;/td&gt;
      &lt;?php
      $date=array(
          'name'=&gt;'datepicker',
          'id'=&gt;'datepicker'
          );
  
  
      ?&gt;
                       &lt;td&gt;&lt;?php echo form_input($date,$up_std_birthdate); ?&gt;&lt;!--&lt;input   type="text" id="datepicker" name="datepicker"   /&gt;--&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_photo'&gt;Photo&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
  
      &lt;?php //echo $error;?&gt;
      &lt;?php echo form_open_multipart('student/do_upload');
  
      echo form_upload('userfile',$up_std_photo);
      echo form_label($up_std_photo);
  
      ?&gt;
  
      &lt;!--&lt;input type="file" name="userfile" size="20" /&gt;--&gt;
      &lt;?php echo form_close();?&gt;
  
      &lt;/td&gt;
  
      &lt;/tr&gt;
  
  
  
      &lt;tr&gt;
      &lt;td&gt;
      &lt;label for='std_ilanguage[]'&gt;Interested Language&lt;/label&gt;
      &lt;/td&gt;
      &lt;td&gt;
  
  
      &lt;!--&lt;select size="" name="ilanguage[]" multiple="multiple"&gt;
  
      &lt;option&gt;.Net&lt;/option&gt;
  
      &lt;option&gt;PHP&lt;/option&gt;
  
      &lt;option&gt;JAVA&lt;/option&gt;
  
      &lt;option&gt;Android&lt;/option&gt;
  
      &lt;option&gt;IPhone&lt;/option&gt;
  
      &lt;/select&gt;--&gt;
      &lt;?php
      $options = array(
                      'select' =&gt; 'Select',
                        '.Net'  =&gt; '.Net',
                        'PHP'    =&gt; 'PHP',
                        'JAVA'   =&gt; 'JAVA',
                        'Android'=&gt; 'Android',
                        'IPhone'  =&gt; 'IPhone'
                      );
  
  
          //$select=array('.Net','PHP','JAVA','Android','IPhone');
          echo form_multiselect('std_ilanguage',$options);
                      ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;
  
      &lt;? echo form_submit('btnupdate','Update!');  ?&gt;
  
      &lt;/td&gt;
      &lt;/tr&gt;
  
  
      &lt;/table&gt;
      &lt;p&gt;&lt;?php echo anchor('delete/test','Go To View!'); ?&gt;&lt;/p&gt;  
      &lt;/form&gt;
      &lt;/html&gt;
      &lt;? echo form_close(); ?&gt;
  </code></pre>
  
  <p>I'm using <code>implode()</code> function but it doesn't get the updated vales so give me solution</p>
  
  <p>Here, all the records of default value is shown into controls but when I checked more than one, it will update only single a checkbox.</p>
  
  <p>Thanks again.</p>