title: Image broken on retrieval from database
body: <p>Code: </p>
  
  <pre><code>$db = mysqli_connect("localhost","root","","photos");
  
  if(isset($_POST['POST'])){
  
  $image = addslashes($_FILES['image']['tmp_name']);
  $image_name = addslashes($_FILES['image']['name']);
  $image = file_get_contents($image);
  $image = base64_encode($image);
  
  
  $sql = "INSERT INTO imaag ( name ) VALUES ('$image')";
  mysqli_query($db,$sql);
  }
  $res = mysqli_query($db,"SELECT * from imaag");
  </code></pre>
  
  <p>and the div in which i'm getting images is: </p>
  
  <pre><code>&lt;div&gt;
      &lt;?php 
      while ($row = mysqli_fetch_array($res)) {
  
      echo '&lt;img 
   src="data:image/jpeg;base64,"'.base64_encode($row['name']).'/&gt;';
      }?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>On retrieval the image is broken, and i don't know if the image is uploaded or not.What I think is that it isn't uploading. Uploading part has some problem.</p>