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

    echo json_encode($response);
}

exit;