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