<?php
header('content-type:application/json');
include($_SERVER['DOCUMENT_ROOT'] . "/API/connection/conn.php");
$json = file_get_contents('php://input');

$get_json = json_decode($json);
if (isset($get_json->userId)) {
    $_GET = json_decode($json, true);
}

$unique_user_id = addslashes(isset($_GET['userId']) ? $_GET['userId'] : '');
if(!empty($unique_user_id)){
    $condition = "WHERE unique_user_id = '$unique_user_id'";
}
$query = mysqli_query($conn, "SELECT * FROM users $condition");
$config_types = array();
while ($spec = mysqli_fetch_assoc($query)) {
    $config_types[] =  $spec;
}


$resultData = array('code' => $statusCode, 'message' => $statusMessage, 'user_information' => $config_types);
echo json_encode($resultData);