<?php  
 include('../config.php');  
 if(isset($_POST["query"]))  
 {  
      $output = '';  
      $query = "SELECT * FROM vendor_master WHERE state LIKE '%".$_POST["query"]."%'";  
      $result = mysqli_query($conn, $query);  
      $output = '<ul class="list-unstyled">';  
      if(mysqli_num_rows($result) > 0){  
         while($row = mysqli_fetch_array($result)) {  
           $output .= '<li>'.$row["state"].'</li>';  
         }  
      }else{  
        $output .= '<li>State Not Found</li>';  
      }  
      $output .= '</ul>';  
      echo $output;  
 }  
 ?>  