<?php
require('../config/connection.php');
if (isset($_POST['search'])) {
    $search = $_POST['search'];
    $query = "select gender from gender_mst where Lower(gender) LIKE Lower('%" . $search . "%') order by gender";
    $result = mysqli_query($con, $query);
    while ($row = mysqli_fetch_array($result)) {
        $response[] = array("label" => $row['gender'], "value" => $row['gender']);
    }
    echo json_encode($response);
}
exit;
