<?php
require('../config/dbcon.php');
if (isset($_POST['search'])) {
    $search = $_POST['search'];
    $query = "select supplier_name,supplier_code,supplier_place,supplier_gstno from supplier_mst where Lower(supplier_name) LIKE Lower('%" . $search . "%') or Lower(supplier_code) LIKE Lower('%" . $search . "%') order by supplier_name limit 10";
    $result = mysqli_query($connect, $query);
    while ($row = mysqli_fetch_array($result)) {
        $response[] = array("label" => $row['supplier_name'], "value" => $row['supplier_code'], "supplier_place" => $row['supplier_place'], "supplier_gstno" => $row['supplier_gstno']);
    }
    echo json_encode($response);
}
exit;
?>