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