title: Showing fake path while updating the image in the database
body: <pre><code>&lt;script type="text/javascript"&gt;
      $('#t').on('click','#btns',function() {
          var id = $(this).attr('data-id');
          var image = $(this).attr('data-image');
  
          $('#dats').val(id);
          $('#Mimage').val(image);
      });
      $(document).ready(function() {
          $.ajax({
              type: "POST",
              url: "query1.php",
              success: function(data) {
                  var parsed = $.parseJSON(data);
                  $.each(parsed, function(i,parsed) {
                      $('#t').append('&lt;tr&gt;&lt;td&gt;'+parsed.id+'&lt;/td&gt;&lt;td id="edi"&gt;&lt;img src="upload/'+parsed.image+'" height = "50px" width = "50px"&gt;&lt;/td&gt;&lt;td&gt;'+'&lt;button class="button info" name="btn" data-toggle="modal" data-target="#Mpn" id="btns" data-id="'+parsed.id+'" data-image="'+parsed.image+'"&gt;Edit&lt;/button&gt;'+'&lt;button class="button info1" name="btn" data-toggle="modal" data-target="#Mpd" id="btns"  data-id="'+parsed.id+'"  data-image="'+parsed.image+'"&gt;Delete&lt;/button&gt;'+'&lt;/td&gt;&lt;/tr&gt;');
                  });
              }
          });
          $('body').on('click','#update',function(e) {
              alert("hi");
              var id = $('#dats').val();
              alert(id);
              var images = $('#Limage').val();
              alert(images);
              $.ajax({
                  type:"POST",
                  url:"upd.php",
                  data:{mode:'upd',id:id,images:images},
                  success:function(data){
                      alert(data);
                      alert("successfully updated");
                  }
              });
          });
      });
  &lt;/script&gt;
  &lt;!Doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
          &lt;script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="modal fade" id="Mpn" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label"&gt;
              &lt;div class="modal-dialog" role="document"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;form class="form-horizontal" id="edit-form"&gt;
                          &lt;input type="hidden" id="dats" name="id" &gt;
                          &lt;div class="modal-header"&gt;
                              &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                              &lt;h4 align="center" class="modal-title" id="edit-modal-label" &gt;Save Changes&lt;/h4&gt;
                          &lt;/div&gt;
                          &lt;div class="modal-body"&gt;
                              &lt;div class="form-group" enctype="multipart/form-data"&gt;
                                  &lt;label for="username" class="col-sm-2 control-label"&gt;Image&lt;/label&gt;
                                  &lt;div class="col-sm-10"&gt;
                                      &lt;input type="text" class="form-control" id="Mimage" name="image" /&gt;
                                      &lt;/br&gt;
                                     &lt;input type="file" class="form-control" id="Limage" name="image"  placeholder=""required&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-footer"&gt;
                                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                                  &lt;button type="submit" class="btn btn-primary"  name="update"  id="update"&gt;Update&lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;?php
      if(($_POST['mode'])=='upd') {
          $id = $_POST['id'];
          echo $id;
          $images = $_POST['images'];
          echo $images;
  
          $query = mysqli_query($con,"UPDATE image SET image = '$images' WHERE id = '".$_POST["id"]."'");
          &lt;img class="img-responsive" src= "upload/3.jpg" alt="image" id="Mimage" name="image" /&gt;
          if($query == true) {
              echo "File Uploaded";
          }
      }
  ?&gt;
  </code></pre>
  
  <p>Context:
  This code is to update the image in the database.This is not working properly when i uploading the image the image enters into the database but as C:fakepathimg.jpg.It is not entering into the actual folder.If it is get rid of fake path the image will be updated.The image displays as fakepath.If the path is correct i think the the image will be updated.</p>