title: Codeigniter : Unknown column 'Array' in 'field list'
body: <p>Hi I want to add a array values in a separate table there are 2 tables in one submit. Office details are inserted but in educational details it could have some errors.</p>
  
  <p>My controller codes are given below:</p>
  
  <pre><code>  public function insertofficedt()
  {   
      $empid = $this-&gt;session-&gt;userdata('last_id');   
      $join_date=$_POST['join_date'];
      $pan_no=$_POST['pan_no'];
      $emp_department=$_POST['emp_department'];
      $emp_designation=$_POST['emp_designation'];
      $emp_jobstatus=$_POST['emp_jobstatus'];
      $joining_salary=$_POST['joining_salary'];
  
      $data=array(
              'emp_id'=&gt;$empid,
              'join_date'=&gt;$join_date,
              'pan_no'=&gt;$pan_no,
              'emp_department'=&gt;$emp_department, 
              'emp_designation'=&gt;$emp_designation, 
              'emp_jobstatus'=&gt;$emp_jobstatus, 
              'joining_salary'=&gt;$joining_salary,
              'joinon'=&gt;date('d-m-Y')
          ); 
      $this-&gt;db-&gt;insert('emp_officedt',$data); 
  
      $r = isset($_POST['college_name']) ? sizeof($_POST['college_name']) : 0;
      for ($i = 0; $i &lt; $r; $i++) {
          //$empid = $this-&gt;session-&gt;userdata('last_id');  
          $college_name = $_POST['college_name'][$i];
          $college_location = $_POST['college_location'][$i];
          $degree = $_POST['degree'][$i];
          $year_passout = $_POST['year_passout'][$i]; 
          if (!empty($college_name) &amp;&amp; !empty($college_location)) {
              $college[] = array(
                  'emp_id' =&gt; $empid,
                  'college_name' =&gt; $college_name,
                  'college_location' =&gt; $college_location,
                  'degree' =&gt; $degree,
                  'year_passout' =&gt; $year_passout 
              );
              //print_r($college);exit();
          }
      }
          $insert = count($college);
      if($insert)
      {
          $this-&gt;db-&gt;insert('emp_edudt', $college);
      } 
      return $insert;
      redirect('employee/addbankdt', 'refresh');     
  }
  </code></pre>
  
  <p>My view codes are as below : </p>
  
  <pre><code>&lt;div class="form-group row"&gt;
      &lt;div class="col-sm-6"&gt; 
          &lt;label&gt;Date Of Joining&lt;/label&gt; 
          &lt;input type="date" name="join_date" class=" form-control" placeholder="Date Of Joining"&gt;
      &lt;/div&gt; 
      &lt;div class="col-sm-6"&gt;
          &lt;label&gt;Pan No&lt;/label&gt; 
          &lt;input type="text" name="pan_no" class=" form-control" placeholder="Pan No"&gt;
      &lt;/div&gt; 
  &lt;/div&gt;
  &lt;div class="form-group row"&gt;
      &lt;div class="col-sm-6"&gt;
          &lt;label&gt;Department&lt;/label&gt; 
          &lt;select name="emp_department" class=" form-control"&gt;  
          &lt;option value=""&gt;Select Department&lt;/option&gt;
              &lt;?php foreach($departments as $process_packed_info){ ?&gt;
              &lt;option value="&lt;?php echo $process_packed_info-&gt;department_id?&gt;"&gt;&lt;?php echo $process_packed_info-&gt;department_name; ?&gt;&lt;/option&gt;
              &lt;?php } ?&gt; 
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="col-sm-6"&gt;
          &lt;label&gt;Designation&lt;/label&gt;  
          &lt;select name="emp_designation" class="form-control"&gt; 
              &lt;option value=""&gt;Select Designation&lt;/option&gt;
              &lt;?php foreach($designation_new as $designation_info){ ?&gt;
              &lt;option value="&lt;?php echo $designation_info-&gt;designation_id; ?&gt;"&gt;&lt;?php echo $designation_info-&gt;designation_name; ?&gt; ?&gt;&lt;/option&gt;
              &lt;?php } ?&gt;  
          &lt;/select&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group row"&gt;
      &lt;div class="col-sm-6"&gt;
          &lt;label&gt;Job Status&lt;/label&gt;
          &lt;select name="emp_jobstatus" class=" form-control"&gt;
              &lt;option value=""&gt;Select Job Status&lt;/option&gt;
              &lt;option value="permanent"&gt;Permanent&lt;/option&gt;
              &lt;option value="temporary"&gt;Temporary&lt;/option&gt; 
          &lt;/select&gt;
      &lt;/div&gt; 
      &lt;div class="col-sm-6"&gt;
          &lt;label&gt;Joining Salary&lt;/label&gt; 
          &lt;input type="text" name="joining_salary" class=" form-control" placeholder="Joining Salary"&gt;
      &lt;/div&gt; 
  &lt;/div&gt;  
  
  &lt;hr color="#0073aa"&gt; 
  &lt;h5&gt;Educational Details&lt;/h5&gt;&lt;br&gt;&lt;br&gt;
  &lt;div class="form-group row"&gt;  
      &lt;div class="col-md-6"&gt;
          &lt;table class="table table-striped table-hover"&gt;
              &lt;tr&gt;
                  &lt;th&gt;College Name&lt;/th&gt;
                  &lt;th&gt;Location&lt;/th&gt;
                  &lt;th&gt;Degree&lt;/th&gt;
                  &lt;th&gt;Year of Passout&lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                    
                          &lt;div class="controls"&gt;&lt;?= form_input('college_name[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;        
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('college_location[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('degree[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                           
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('year_passout[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                             
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                    
                          &lt;div class="controls"&gt;&lt;?= form_input('college_name[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;        
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('college_location[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('degree[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                           
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('year_passout[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                             
              &lt;/tr&gt; 
              &lt;tr&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                    
                          &lt;div class="controls"&gt;&lt;?= form_input('college_name[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;        
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('college_location[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('degree[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                           
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt;                 
                          &lt;div class="controls"&gt;&lt;?= form_input('year_passout[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                             
              &lt;/tr&gt; 
          &lt;/table&gt;
      &lt;/div&gt;
      &lt;div class="col-md-6"&gt;
          &lt;table class="table table-striped table-hover"&gt;
              &lt;tr&gt;
                  &lt;th class="text-center"&gt;School Name&lt;/th&gt;
                  &lt;th class="text-center"&gt;Location&lt;/th&gt;
                  &lt;th class="text-center"&gt;Standard&lt;/th&gt;
                  &lt;th class="text-center"&gt;Year of Passout&lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('school_name[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;        
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('school_location[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('standard[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                           
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('passout[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                             
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('school_name[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;        
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('school_location[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('standard[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                           
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('passout[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                             
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('school_name[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;        
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('school_location[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('standard[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                           
                  &lt;td&gt; 
                      &lt;div class="form-group"&gt; 
                          &lt;div class="controls"&gt;&lt;?= form_input('passout[]', '', 'class="form-control" style="padding: 5px 13px;"');?&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt; 
                  &lt;/td&gt;                             
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to store a record in array format.Kindly help me the to solve the issues. I am new for codeigniter.</p>