0 && $sessionId > 0) { $cacheKey = "userhistory_" . intval($userId) . "_" . intval($quickMode); $cached = cache_get($sessionId, $cacheKey); if ($cached !== null) { print_r($cached); } else { $stats = new StatsObject($db); $stats->getUserHistory($userId, $sessionId, $quickMode); $stats_arr = $stats->getResultArray(true, "Results_Collected_OK"); $json = json_encode($stats_arr); cache_put($sessionId, $cacheKey, $json); print_r($json); // OK } } ?>