<?php
$term=$_POST['q'];
require_once "config.php";
$sql="select * from hotels where hotel_name like '%".$term."%' group by hotel_name limit 10";
$query=mysqli_query($con,$sql);
$data=array();
while($result=mysqli_fetch_array($query,MYSQLI_ASSOC)){
    $data[]=array(
        "label"=>$result['hotel_name'],
         "value"=>$result['id'],
         
        
    );
    
}
echo json_encode($data);
?>