<?php
header('content-type:application/json');
include($_SERVER['DOCUMENT_ROOT'] . "/API/connection/conn.php");
$token = addslashes(isset($_GET['token']) ? $_GET['token'] : '');
$query = "SELECT role, nationality, living_town, fullname, dob, email, phone, whatsapp_no, date_added FROM users WHERE auth_code = '$token'";
$result = mysqli_query($conn, $query);
$rowCount = mysqli_num_rows($result);
if ($rowCount > 0) {
    $postData = array();
    while ($row = mysqli_fetch_assoc($result)) {
        $statusCode = 200;
        $statusMessage = "Signed In Successfully";
        $postData[] = $row;
    }
}
$resultData1 = array('code' => $statusCode, 'message' => $statusMessage, 'data' => $postData);
echo json_encode($resultData1);
