提交表单不刷新,并将mysql返回的行追加到表中

I can't seem to properly append all rows returned by the server to the body of my table. Here is my ajax code. The HTML is just below. Like I can see that a reponse is returned, it's nnot just attached to my existing table. Can someone help me how to solve this? I have been trying for hours I have to demo it to my boss today

<script type="text/javascript">
$(document).ready(function() {
    $(document).on('submit', '#formID', function() {
        var data = $(this).serialize();
        $.ajax({
            type : 'POST',
            url  : 'search.php',
            data : data,
            success :  function(data) {
                $('.result').append(data);
            }
        });
        return false;
    });
});
</script>

HTML

<table id="example3" class="display" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>***</th>
            <th>Description</th>
            <th>**</th>
            <th>Source</th>
            <th></th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <th>***</th>
            <th>Description</th>
            <th>**</th>
            <th>Source</th>
            <th></th>
        </tr>
    </tfoot>
    <tbody class="result">

    </tbody>
</table>


<?php


$servername = "*****";
$username = "*****";
$password = "*****";
$dbname = "*****";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}


    $fields = array('*****', '*****', '*****', '*****', '*****');

    $conditions = array();

  foreach($fields as $field){
        // if the field is set and not empty
        if(isset($_POST[$field]) && $_POST[$field] != '') {
            // create a new condition while escaping the value inputed by the user (SQL Injection)
            $conditions[] = "`$field` LIKE '%" . mysqli_real_escape_string($conn,$_POST[$field]) . "%'";
        }
    }


$query = " SELECT * FROM $dbname.***** P ";

            if(count($conditions) >0) {

            $query .= "WHERE " . implode (' AND ', $conditions); // you can change to 'OR', but I suggest to apply the filters cumulative
    }               

    $result = mysqli_query($conn,$query);

if (!$result) {
    echo "ERRORS";
}

    while($row = $result->fetch_assoc())  {
         echo "<tr><td>" .$row['*****'] . "</td><td>*****</td><td>September 12 1993</td><td>*****</td><td>May 24 1998</td><td>May 24 2005</td><td>*****</td><td>*****</td> </tr>";                       

     }



$conn->close();
?>
success :  function(data) {
                $('.result').append(data);
            }

should be changed to have:

success :  function(data) {
                $('.result').append($.parseHTML(data));
            }

i was wondaring where is ur serch.php page where u post the data and get the response into ur fontend page. index.php

<table id="example3" class="display" cellspacing="0" width="100%">
<thead>
    <tr>
        <th>***</th>
        <th>Description</th>
        <th>**</th>
        <th>Source</th>
        <th></th>
    </tr>
</thead>
<tfoot>
    <tr>
        <th>***</th>
        <th>Description</th>
        <th>**</th>
        <th>Source</th>
        <th></th>
    </tr>
</tfoot>
<tbody class="result">

</tbody>

<script type="text/javascript">
$(document).ready(function() {
$(document).on('submit', '#formID', function() {
    var data = $(this).serialize();
    $.ajax({
        type : 'POST',
        url  : 'search.php',
        data : data,
        success :  function(data) {
            $('.result').append(data);
        }
    });
    return false;
 });
 });
</script>

search.php

<?php
 $servername = "*****";
 $username = "*****";
 $password = "*****";
 $dbname = "*****";
 $conn = new mysqli($servername, $username, $password, $dbname);
 if ($conn->connect_error) {
     die("Connection failed: " . $conn->connect_error);
  }
$fields = array('*****', '*****', '*****', '*****', '*****');

$conditions = array();
foreach($fields as $field){
    // if the field is set and not empty
    if(isset($_POST[$field]) && $_POST[$field] != '') {
        // create a new condition while escaping the value inputed by the user (SQL Injection)
        $conditions[] = "`$field` LIKE '%" . mysqli_real_escape_string($conn,$_POST[$field]) . "%'";
    }
}
$query = " SELECT * FROM $dbname.***** P ";

        if(count($conditions) >0) {

        $query .= "WHERE " . implode (' AND ', $conditions); // you can change to 'OR', but I suggest to apply the filters cumulative
}               

$result = mysqli_query($conn,$query);

 if (!$result) {
    echo "ERRORS";
 }

while($row = $result->fetch_assoc())  {
     echo "<tr><td>" .$row['*****'] . "</td><td>*****</td><td>September 12 1993</td><td>*****</td><td>May 24 1998</td><td>May 24 2005</td><td>*****</td><td>*****</td> </tr>";                       

 }
 $conn->close();
?>