<?php 
include "../config.php";
if(isset($_POST['search'])){
    $search = $_POST['search'];
    $query = "SELECT * FROM vendor_master WHERE name LIKE '%" . $search . "%' AND type = 'V' ";
    $result = mysqli_query($conn,$query);
    while($row = mysqli_fetch_array($result) ){
        $response[] = array("value"=>$row['name'],"label"=>$row['name']);
    }
    echo json_encode($response);
}
exit;