<?php session_start(); ?>
<html>
<head>
</head>
<script>
    src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">
</script>
    
<body>
<?php error_reporting(0); ?>    
<form action="" method="post" name="srch">   
<input list="listinv" id="search" name="search" size="65">
<datalist id="listinv">
    <?php
        $con = @mysqli_connect("localhost", "root", "abc456", "ProudAsiaDB") 
                or die(mysqli_connect_error());
        mysqli_query($con,"set names utf8"); 
    
        $select = "SELECT DISTINCT C_NAME FROM cust001 ORDER BY C_NAME ASC ";
        $query = mysqli_query($con,$select);
            while($result = mysqli_fetch_array($query))
            {
    ?> 
        <option value="<?php echo $result["C_NAME"];?>">
            <?php echo $result["C_NAME"]; ?>
        </option>
          <?php
              }
          ?>  
</datalist>    
<br>    
<?php   
if(isset($_POST['search'])) {           
    $srch=$_POST['search'];
    //echo "Selected Name : ".$srch;
    $slct="SELECT * FROM cust001 WHERE C_NAME LIKE '%$srch%'";
    $qry=mysqli_query($con,$slct);
    while($rslt = mysqli_fetch_array($qry)){
        echo $rslt["C_NO"]."<br>";
        echo $rslt["C_NAME"];
    }
}
?>
</form> 
</body>
</html>