<?php 
include "../config.php";
if(isset($_POST['search'])){
    $search = $_POST['search'];
    $query = "SELECT * FROM truck_mst WHERE tr_city like'%".$search."%'";
    $result = mysqli_query($conn,$query);
    
    while($row = mysqli_fetch_array($result) ){
        $response[] = array("value"=>$row['tr_city'],"label"=>$row['tr_city']);
    }

    echo json_encode($response);
}

exit;


