title: Error : Unknown column 'Array' in 'field list' (codeigniter)
body: <p>I am getting this error </p>
  
  <blockquote>
    <p>Unknown column 'Array' in 'field list'</p>
  </blockquote>
  
  <p>When inserting checkbox list into database. When I do <strong>print_array</strong> I am getting this result :</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [user_id] =&gt; 3
              [project_id] =&gt; 10
              [project_type] =&gt; 5
              [project_list] =&gt; Array
                  (
                      [0] =&gt; 17
                      [1] =&gt; 18
                  )
  
          )
  
  )
  </code></pre>
  
  <p>The <code>project_list</code> value supposed to be inserted into a new row in the database.</p>
  
  <p><strong>my view</strong> : <code>&lt;input type="checkbox" value="&lt;?php echo $project_list['id']; ?&gt;" name="project_list[]"&gt;</code> which is populated from database.</p>
  
  <p><strong>my controller</strong> : <code>$this-&gt;Project_module-&gt;createProject($_POST['project_list']);</code></p>
  
  <p><strong>my module</strong></p>
  
  <pre><code>public function createProject($project_list){
  
      if($project_list != null){
  
          $data = array();
  
          foreach($project_list as $project_list){
              $data[] = array(
                  'user_id'          =&gt; $this-&gt;getUserId(),
                  'project_id'       =&gt; $this-&gt;getProjectId(),
                  'project_type'     =&gt; $this-&gt;getProjectType(),
                  'project_list'     =&gt; $this-&gt;getProjectList(),
              );
          }
  
          $this-&gt;db-&gt;insert_batch('tblProject', $data);
  
          if($this-&gt;db-&gt;affected_rows()){
              return true;
          } else {
              return false;
          }
  
      } 
  
  }
  </code></pre>
  
  <p><strong>EDIT</strong>
  I was edited my foreach like this</p>
  
  <pre><code>foreach($project_list as $row){
      $data = array(
          'user_id'          =&gt; $this-&gt;getUserId(),
          'project_id'       =&gt; $this-&gt;getProjectId(),
          'project_type'     =&gt; $this-&gt;getProjectType(),
          'project_list'     =&gt; $this-&gt;getProjectList(),
      );
  }
  </code></pre>
  
  <p>But I am still getting the same error.</p>