i added a search button which is connected to my database and i want to display the result data on bootstrap model, upon clicking on the search button my page is auto refreshing and model doesn't open, when i hit the search button again it shows the data. i want to show my data on bootstrap model on first click without refreshing the page.
  <!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <title>Hello, world!</title>
  </head>
  <body>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Notification</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
      <?php
$con = new PDO("mysql:host=localhost;dbname=blog",'root','');
if (isset($_POST["submit"])) {
    $str = $_POST["search"];
    $sth = $con->prepare("SELECT * FROM `data` WHERE plotnumber = '$str'");
    $sth->setFetchMode(PDO:: FETCH_OBJ);
    $sth -> execute();
    if($row = $sth->fetch())
    {
        ?>
        <br><br><br>
        <table>
            <!-- <tr>
                <th>plotnumber</th>
                <th>plotdetail</th>
                <th>verified</th>
                <th>size</th>
                <th>status</th>
            </tr> -->
            <tr>
                <td><?php echo $row->plotnumber; ?></td>
                <td><?php echo $row->plotdetail;?></td>
                <td><?php echo $row->verified;?></td>
                <td><?php echo $row->size;?></td>
                <td><?php echo $row->status;?></td>
            </tr>
        </table>
<?php 
    }
        
        
        else{
            echo "Name Does not exist";
        }
}
?>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
  <form method="post">
<label>Search</label>
<input type="text" name="search" required>
<input type="submit" name="submit" data-toggle="modal" data-target="#exampleModal">
    
</form>
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  </body>
</html>
 
    