<?php
$servername = "localhost";
$username = "venmobdc_OnlineClassuser";
$password = "EuN&(VkTztyS";
$database = "venmobdc_OnlineClass";

// Create connection
$conn = new mysqli($servername, $username, $password, $database);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

if (isset($_POST['number'])) {
    $number = $_POST['number'];
    $sql = "SELECT name, password, point, Device_Active_Check, mobile, Device_Token_FCM FROM User_Details WHERE mobile = ?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("s", $number);
    $stmt->execute();
    $result = $stmt->get_result();

    $data = array();
    while ($row = $result->fetch_assoc()) {
        $data[] = $row;
    }

    header('Content-Type: application/json');
    echo json_encode($data);
}

$conn->close();
?>
