title: CodeIgniter And Image Display in Table
body: <p>I'm using codeIgniter and uploading image path along with form data in database. The problem that i'm facing is they're not displaying in table. Images are successfully uploaded in the folder and the path is also saved in db but it's not displaying the images.
  Code that i've written is below.
  In view file:</p>
  
  <pre><code>&lt;?php echo form_open_multipart('welcome/insertion'); ?&gt;
  &lt;input type="file" name="userfile" id="userfile" size="40" maxlength="90" tabindex="3"/&gt;
  &lt;input name="saveForm" type="submit" value="Insert Record" class="iconSave" /&gt;
  </code></pre>
  
  <p>In controller i write:</p>
  
  <pre><code>public function insertion()
  {
      $this-&gt;load-&gt;model('data_maintenance','',TRUE);
      $this-&gt;data_maintenance-&gt;insertion();
  }
  </code></pre>
  
  <p>And finally in model:
      public function insertion()
      {</p>
  
  <pre><code>    $config['upload_path'] = 'application/uploads';
      $config['allowed_types'] = 'gif|jpg|jpeg|png|pdf';
      $config['max_size'] = '5000';
      $this-&gt;load-&gt;library('upload', $config);
      $this-&gt;upload-&gt;initialize($config);
      if ( ! $this-&gt;upload-&gt;do_upload('userfile'))
      {
          echo $this-&gt;upload-&gt;display_errors();
  
  
      }
      else
      {
          //$file_data  =   $this-&gt;upload-&gt;data('image');
          $file_data = $this-&gt;upload-&gt;data();
  
          $new_staff = array(
                  'agenda_id' =&gt; $this-&gt;input-&gt;post('agenda_id'),
                  't_name' =&gt; $this-&gt;input-&gt;post('t_name'),
                  'exp' =&gt; $this-&gt;input-&gt;post('exp'),
                  'leaves_allow_monthly' =&gt; $this-&gt;input-&gt;post('leaves_allow_monthly'),
                  'leaves_allow_annualy' =&gt; $this-&gt;input-&gt;post('leaves_allow_annualy'),
                  'gender' =&gt; $this-&gt;input-&gt;post('gender'),
                  'cell_no' =&gt; $this-&gt;input-&gt;post('cell_no'),
                  'dob' =&gt; $this-&gt;input-&gt;post('dob'),
                  'file' =&gt; $file_data['file_name']
  
          );
  
  
      }
      $d="/SampleOOP/application/uploads/" . $new_staff['file'];
      $this-&gt;db-&gt;set('image', $d);
      //$this-&gt;db-&gt;insert('teachers_record');
  
  
      //$d="/SampleOOP/application/uploads/".$new_staff['file'];
      $this-&gt;db-&gt;set('teacher_name', $new_staff['t_name']);
      //$this-&gt;db-&gt;set('image',$d);
      $this-&gt;db-&gt;insert('teachers_record');
  
      }
  </code></pre>