<?php

require_once './connection.php';

if (!isset($_POST['mobileno']) == "") {
    $mobileno = $_POST['mobileno'];
//    echo '$district_id '.$district_id;
    $result = array();

    $sql = 'select * from tbl_school_user where mobile_no="'.$mobileno.'" and flag="1" ORDER by id ASC';
//echo 'query ' . $sql;
    try {
        if ($con) {
            mysqli_set_charset($con, 'utf8');
            $response = mysqli_query($con, $sql);
//        print_r($response);
            if (mysqli_num_rows($response) > 0) {

                while ($row = mysqli_fetch_assoc($response)) {
                    $index["id"] = $row["id"];
                    $index["full_name"] = $row["full_name"];
                    $index["mobile_no"] = $row["mobile_no"];

                    array_push($result, $index);
                }
//            $result["success"] = "1";
                echo json_encode($result);
            } else {
                echo 'NO_MobileNo_Found';
            }
        } else {
            echo 'Connection Problem';
        }
    } catch (Exception $ex) {
        echo $e->getMessage();
    }
} else {
    echo 'Mobileno is Null';
}
?>
