title: How to display image from database in CodeIgniter?
body: <p>I am using CodeIgniter 2.1.0 and MySQL database. I have uploaded an image through a form and successfully stored it in a uploads directory and I have also successfully stored the full path of the image in my database. but i am having problem with showing the image by calling the full path from my database.</p>
  
  <p>Here is my code for the upload:</p>
  
  <pre><code>$image_path = realpath(APPPATH . '../uploads');
  
  $config = array(
      'allowed_types' =&gt; 'jpeg|png|gif|jpg', 
      'upload_path' =&gt; $image_path, 
      'max_size' =&gt; 2097152, 
      'overwrite' =&gt; TRUE, 
      'file_name' =&gt; '_' . $i . '_'
  );
  
  $this -&gt; load -&gt; library('upload', $config);
  </code></pre>
  
  <p>When I am storing the full path of the image in my database, it looks something like this</p>
  
  <pre><code>C:/wamp/www/my_project/uploads/_1_.jpg
  </code></pre>
  
  <p>If i try</p>
  
  <pre><code>&lt;img src="&lt;?php echo $data['screenshot'];?&gt;" /&gt;
  //($data['screenshot'] refers to the image location retrieved from database)
  </code></pre>
  
  <p>this in my view file, no image is displayed. What am I doing wrong? Please someone tell me. What is the standard procedure?</p>