<?php
// include database and object files
include_once '../config/init.php';	// contains $db
include_once '../config/error.php';
include_once '../objects/stats_object.php';

$userId = isset($_POST['userId']) ? $_POST['userId'] : -1;
$typeId = isset($_POST['typeId']) ? $_POST['typeId'] : -1;

$stats = new StatsObject($db);
$stats->getSessionsForUser($userId, $typeId);

$stats_arr = $stats->getResultArray(true, "User_Sessions_List_OK");
print_r(json_encode($stats_arr));	// OK
?>