如何像即时搜索一样创建谷歌?

I am trying to make an instant search from 2 weeks now,and there is no way guys,I tried all things that i know(which isn't much) I just fixed the errors,and from there. nothing.So I guess I don't need to explain you what code must do,because you all have search menus in your websites..One of big problems is (if it is problem) $_ajax ; $_POST methods,when I type the URL property to which info must be posted,it always is like browser URL not like a file if I put it like that Food-Groups-BG.php it will give error NOT FOUND ,no matter if the name is right or wrong. And at the moment my code isn't really do much and neither is giving any error. Just giving that in console http://prntscr.com/dtoonf.

Here is my code!

jQuery(document).ready(function ($) {
    $("#food_search").keyup(function(event) {
        var search_term =$(this).val();
        $.ajax({
            type:"POST",
            url:"/Food-Search",
            data:{fsearch:search_term},
            success:function(res) {
                $("#food_search_result").html(res);
            },
            error: function (xhr, ajaxOptions, thrownError) {
                alert(xhr.status);
                alert(xhr.responseText);
                alert(thrownError);
            }
        });
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!----------------------------------------------------------------
                              HTML
----------------------------------------------------------------->
<p>Търсене на храни: <input type="text" name="food-search" id="food_search"></p>
<!----------------------------------------------------------------
                               PHP
----------------------------------------------------------------->
<?php
$hostname = "localhost";
$username = "username";
$password = "pass";
$databaseName = "dbName";

$connect = mysqli_connect($hostname, $username, $password, $databaseName);
if(isset($_POST['fsearch']) && $_POST['fsearch']!="") {
    $fsearch = $connect->prepare("SELECT * FROM food_data_bg WHERE search_term LIKE :title");
    $fsearch->execute(array(
        'title'=>'%'.$_POST['title'].'%'
    ));
    if($fsearch->rowCount()==0) {
        echo 'Не бяха намерени резултати!';
    } else {
        while($data=$fsearch->fetch()) {
        ?>
            <div class="search-result">
                <img src="<?php echo $data['fimage']; ?>" class="fimage"/>
                <span class="result-title"><?php echo $data['title'];?></span><br>
                <span class="calories-total"><?php echo $data['calories total'];?></span><br>
            </div>
        <?php
        }
    }
}
?>

Any help is appreciated.

</div>

You have to use json_encode function on your php page in order to fetch the results properly! Echo your array like echo json_encode($array); also be aware that your page must not contain any headers therefore print it out on a empty page.