title: How to retrieve image from folder in code igniter
body: <p>In my application, i have upload image and fill some fields. These values and upload image path also to be saved in database. I don't know to how to retrieve image from folder. My code is, </p>
  
  <p>The Controller part is</p>
  
  <pre><code>function getdatatableajax()
   {
  
  $this-&gt;load-&gt;library('datatables');
  $this-&gt;datatables
  -&gt;select("products.id as id, pathinfo, products.name as pname, price,   measurement, tax_rates.name")// measurement,tax_rates.name
  -&gt;from("products")
  -&gt;join('tax_rates', 'tax_rates.id=products.tax_rate', 'left')
  -&gt;group_by('products.id')
  
  -&gt;add_column("Actions", 
      "&lt;center&gt;
          &lt;div class='btn-group'&gt;
          &lt;a class=\"tip btn btn-primary btn-xs\" title='".$this-&gt;lang-&gt;line("edit_product")."' href='index.php?module=products&amp;amp;view=edit&amp;amp;id=$1'&gt;
          &lt;i class=\"fa fa-edit\"&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;a class=\"tip btn btn-danger btn-xs\" title='".$this-&gt;lang-&gt;line("delete_product")."' href='index.php?module=products&amp;amp;view=delete&amp;amp;id=$1' onClick=\"return confirm('". $this-&gt;lang-&gt;line('alert_x_product') ."')\"&gt;
          &lt;i class=\"fa fa-trash-o\"&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;/div&gt;&lt;/center&gt;", "id")
  
  -&gt;unset_column('id');
  
  
  echo $this-&gt;datatables-&gt;generate();
  
   }
  </code></pre>
  
  <p>The model part is</p>
  
  <pre><code>public function getAllProducts() 
  {
      $q = $this-&gt;db-&gt;get('products');
      if($q-&gt;num_rows() &gt; 0) {
          foreach (($q-&gt;result()) as $row) {
              $data[] = $row;
          }
  
          return $data;
      }
  }
  </code></pre>
  
  <p>The View part is</p>
  
  <pre><code>&lt;table id="fileData" cellpadding=0 cellspacing=10 class="table table-bordered table-hover table-striped"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("Image"); ?&gt;&lt;/th&gt;
           &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("name"); ?&gt;&lt;/th&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("price"); ?&gt;&lt;/th&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("Measurement"); ?&gt;&lt;/th&gt; 
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("tax_rate"); ?&gt;&lt;/th&gt;
          &lt;th style="width:45px;"&gt;&lt;?php echo $this-&gt;lang-&gt;line("actions"); ?&gt;&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td colspan="7" class="dataTables_empty"&gt;&lt;?php echo $this-&gt;lang-&gt;line('loading_data_from_server'); ?&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
      &lt;tfoot&gt;
      &lt;tr&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("Image"); ?&gt;&lt;/th&gt;
           &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("name"); ?&gt;&lt;/th&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("price"); ?&gt;&lt;/th&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("Measurement"); ?&gt;&lt;/th&gt; 
          &lt;th&gt;&lt;?php echo $this-&gt;lang-&gt;line("tax_rate"); ?&gt;&lt;/th&gt;
          &lt;th style="width:45px;"&gt;&lt;?php echo $this-&gt;lang-&gt;line("actions"); ?&gt;&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/tfoot&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>From where are add image retrieval code.?</p>