"Unauthorized method"]); }else{ include_once '../dbConnection.php'; include_once '../models/User.php'; $db= new Database(); $db= $db->establishConnection(); $user = new User($db); $user->id="U0004"; $stmt = $user->readOneId(); if($stmt != false){ $row = $stmt->fetch(PDO::FETCH_ASSOC); extract($row); $user= [ "id" => $id, "username" => $username, "password" => $password, "nationality" => $nationality, "sex" => $sex, "dateofBirth" => $dateOfBirth, "currentBobCoins"=>$currentBobCoins, "totalBobCoins" => $totalBobCoins, "nbGamesPlayed" => $nbGamesPlayed, ]; http_response_code(200); echo json_encode($user); } } ?>