title: Inserting multiple row in mysql with codeigniter
body: <p>I am trying to upload multiple images with description in  codeigniter. Everything is fine, image is uploaded, image filename is sent to database however "description" is not going to database, where did i mistake ?</p>
  
  <pre><code>form code is like this 
    File 1: &lt;input type="file" name="image1" /&gt;&lt;br /&gt;
    Descr: &lt;input type="text" name="description[]" size="50" value="" /&gt;&lt;br/&gt;&lt;br/&gt;
  
    File 2: &lt;input type="file" name="image2" /&gt;&lt;br /&gt;
    Descr: &lt;input type="text" name="description[]" size="50" value="" /&gt;&lt;br/&gt;&lt;br/&gt;
  
    File 3:&lt;input type="file" name="image3" /&gt;&lt;br /&gt;
    Descr: &lt;input type="text" name="description[]" size="50" value="" /&gt;&lt;br/&gt;&lt;br/&gt;
  </code></pre>
  
  <p>and model is this </p>
  
  <pre><code>for($i = 1; $i &lt; 6; $i++) {
                      /* Handle the file upload */
                      $upload = $this-&gt;upload-&gt;do_upload('image'.$i);
                      /* File failed to upload - continue */
                      if($upload === FALSE) continue;
                      /* Get the data about the file */
                      $data = $this-&gt;upload-&gt;data();
  
                      $uploadedFiles[$i] = $data;
                      /* If the file is an image - create a thumbnail */
                      if($data['is_image'] == 1) {
                          $configThumb['source_image'] = $data['full_path'];
                          $this-&gt;image_lib-&gt;initialize($configThumb);
                          $this-&gt;image_lib-&gt;resize();
                      }
  
  
                          $image['raw'] = $data['raw_name'];
                          $image['ext'] = $data['file_ext'];
                          $image['newsid'] = $_POST['newsid'];
                          $image['description'] = $_POST['description'][$i];
                          $this-&gt;db-&gt;insert('multipics', $image);
                  }
  </code></pre>
  
  <p>Please note that the above code makes multiple rows insertion, I just need the description field to go in database</p>