title: How to set a already uploaded image as default input(type=file) in the html form?
body: <p>I wanna update an image in my database table. So first I made a MySQL query to display already uploaded Image in the HTML form web page. And after that, I made another query to update Image... So now I want that If I don't choose any Image for the update then <strong>already uploaded Image</strong> should be selected as default input in the form. So How can I set the <strong>already uploaded</strong> image as default input in the form? Please help me out...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;img src="../images/&lt;?php echo $post_image ?&gt;" width="100px"&gt;
  &lt;input type="file" name="image" class="form-control-file"&gt;
  
  &lt;!-------------------Display Image---------------------&gt;
  &lt;?php
  
      $query = "SELECT * FROM posts WHERE post_id=$post_id ";
      $getPost = mysqli_query($connection, $query);
  
      while ($row = mysqli_fetch_assoc($getPost)) {
          $post_image = $row['post'];
      }    
          
  ?&gt;
  
  &lt;!------------------Update Image-------------------&gt;
  &lt;?php 
  
  if (isset($_POST['publish_edit'])) {
      $post_image = $_FILES['image']['name'];
      $post_image_temp = $_FILES['image']['tmp_name'];
  
      move_uploaded_file($post_image_temp, "../images/$post_image");
      
      $query = "UPDATE posts SET ";
      $query .= "post_image = '$post_image' ";
      $query .= "WHERE post_id = $post_id ";
      
      $editPost = mysqli_query($connection, $query);
      }
  
  ?&gt;</code></pre>
  </div>
  </div>
  </p>