title: Image doesn't appear on MYSQL database
body: <p>My problem is that if i try to post a image trought my website to my database called photos they don't appear there. Images do appear inside the folder i created upload/img. My database photos table is called images with 2 rows. id int(11) and image MEDIUMBLOB. Any ideas why doesn't my images appear on my MYSQL database?</p>
  
  <pre><code>    &lt;?php session_start(); ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Image Upload&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;?php if(isset($_SESSION['err'])){ ?&gt;
      &lt;h2&gt;&lt;?php echo $_SESSION['err']; ?&gt;&lt;/h2&gt;
    &lt;?php session_unset(); } ?&gt;
    &lt;form method="post" action="upload.php" enctype="multipart/form-data" &gt;
      &lt;input type="file" name="image" /&gt;
      &lt;input type="submit" value="Submit" name="save"&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My upload.php</p>
  
  <pre><code>&lt;?php
  
  require_once('config.php');
  session_start();
  if(isset($_POST['save']))
  {
    $target_dir = "upload/img/";
    $filename = explode('.',$_FILES['image']['name']);
    $ext = $filename[1];
    $imgname = time().'.'.$ext;
    $target_file = $target_dir . $imgname ;
   if (move_uploaded_file($_FILES["image"]["tmp_name"], $target_file)) {
        $path=$imgname;
        $conn-&gt;query("INSERT INTO images (id, image)VALUES ('$path')");
        $_SESSION["Success"]='Image Is Upload Success...';
        header("Location:view.php"); /* Redirect browser */
        exit();
      } else {
        $_SESSION["err"]=$text;
        header("Location:index.php"); /* Redirect browser */
        exit();
      }
    }
  }
  
  ?&gt;
  </code></pre>
  
  <p>Here is picture of my "images" table.</p>
  
  <p><a href="https://i.stack.imgur.com/Lk0ou.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lk0ou.png" alt="enter image description here"></a></p>