2026-03-09 07:12:13 +01:00

22 lines
603 B
PHP

<?php
// include database and object files
include_once '../config/init.php'; // contains $db
include_once '../config/error.php';
include_once '../objects/db_user.php';
// prepare user object
$user = new User($db);
// read mandatory $_POST properties : ensure userId is passed in $_POST parameters
if (isset($_POST['userId']))
$user->id = $_POST['userId'];
else trigger_error( missing_parameter_error("userId") );
// create the game session
if ($user->load())
{
$user_arr = $user->getResultArray(true, "User_Found");
print_r(json_encode($user_arr)); // OK
}
else trigger_error("Error_Occured");
?>