mobmash.click/lib/updateCache.php

24 lines
520 B
PHP
Raw Normal View History

2024-08-03 16:17:14 +00:00
<?php
function updateCache(): void {
global $pdo;
$query = $pdo->query(<<<EOF
INSERT INTO mm_history_cache
SELECT
ratings,
last_update
FROM mm_rating_history
WHERE last_update > (
SELECT max(last_update)
FROM (
SELECT last_update
FROM mm_history_cache
UNION ALL
SELECT 0
) AS with_default
)
EOF
);
$query->execute();
}