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