title: how to display image from path stored in database?
body: <p>I got the image path inserted in to database by the below code but I'm not able to display it in html page...the path for the images is <code>"images/"</code> how do i display the actual image? i tried hard but the most i got to work was to display the file name not the image.</p>
  
  <pre><code>&lt;?php
  $mysqli = new mysqli("localhost", "root", "", "simple_login");
  
  // TODO - Check that connection was successful.
  
  $photo= "images/" . $_FILES["file"]["name"];
  
  $stmt = $mysqli-&gt;prepare("INSERT INTO photo (photo) VALUES (?)");
  
  // TODO check that $stmt creation succeeded
  
  // "s" means the database expects a string
  $stmt-&gt;bind_param("s", $photo);
  
  $stmt-&gt;execute();
  
  $stmt-&gt;close();
  
  $mysqli-&gt;close(
  
  ?&gt;
  </code></pre>
  
  <p>here is what I tried to display image ...this only shows the file name with path.....</p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","root","");
  if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  
  mysql_select_db("simple_login", $con);
  
  $result = mysql_query("SELECT * FROM photo");
  
  while($row = mysql_fetch_array($result))
  {
  echo $row['photo'];
  echo "&lt;br /&gt;";
  }
  
  mysql_close($con);
  ?&gt; 
  </code></pre>