title: how to insert image in database using phpmyadmin?
body: <p>im develop website using xampp localhost. I want to add image using phpmyadmin but i can't add it..the image can display in phpmyadmin but can't appear on my website..is it any wrong with my coding in php?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$host="localhost"; // Host name 
  $username="root"; // Mysql username 
  $password=""; // Mysql password 
  $db_name="MMDB"; // Database name 
  $tbl_name="artist"; // Table name 
  
  // Create connection
  $conn = mysqli_connect($host, $username, $password, $db_name);
  // Check connection
  if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
  }
  $Name=$_POST['Name']; 
  $Hometown=$_POST['Hometown']; 
  $Income=$_POST['Income'];
  $Image=$_POST['Image'];
  //file   =$_FILES['image']['tmp_name'];
  $Video=$_POST['Video']; 
  $sql = "INSERT INTO $tbl_name(Name, Hometown, Income, Image, Video)
  VALUES ('$Name', '$Hometown','$Income','$Image','$Video')";
  
  
  if (mysqli_query($conn, $sql)) {
  
      include 'admin.php';
  } else {
      echo "x";
  }
  
  
  mysqli_close($conn);
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <hr>
  
  <p>whats the code for add image in folder?</p>
  
  <p>// where should i insert this code ">
      $image = $_FILES["image"]["name"];
      $uploadedfile = $_FILES['image']['tmp_name'];
      if ($image) {
               $filename = stripslashes($_FILES['image']['name']);</p>
  
  <pre><code>         /* Ensure the file is JPG/PNG */
           if (($_FILES['image']['type'] != "image/jpg") &amp;&amp; ($_FILES['image']['type'] != "image/jpeg") &amp;&amp; ($_FILES['image']['type'] != "image/png")) { $error_status = 2; $error_message = "File uploaded was not a JPG or PNG file."; }  
           else {
             /* Ensure the file is less than 10MB */
             $size = filesize($_FILES['image']['tmp_name']);
             if ($size &gt; (MAX_SIZE * 1024)) { $error_status = 3; $error_message = "File uploaded needs to be less than 10MB."; }
             else {
               $extension = "jpg";
               if(($_FILES['image']['type'] == "image/jpg") || ($_FILES['image']['type'] == "image/jpeg")) { $uploadedfile = $_FILES['image']['tmp_name']; $src = imagecreatefromjpeg($uploadedfile); }
               else if (($_FILES['image']['type'] == "image/png")) { $extension = "png"; $uploadedfile = $_FILES['image']['tmp_name']; $src = imagecreatefrompng($uploadedfile); }
               $img_mime_type = $_FILES['image']['type'];
  </code></pre>