Fix Quiz Self Hosting (1)

This commit is contained in:
2026-05-12 23:03:28 +02:00
parent 0445353013
commit ecd2b96bae
+2 -1
View File
@@ -30,7 +30,8 @@ try {
$queries = []; $queries = [];
$seed = date('Ymd'); $seed = date('Ymd');
foreach ($allowedTables as $key => $table) { foreach ($allowedTables as $key => $table) {
$queries[] = "(SELECT explanation, planete_nom, url FROM $table WHERE explanation IS NOT NULL AND explanation != '' ORDER BY RAND($seed) LIMIT 3)"; $planetName = ucfirst($key);
$queries[] = "(SELECT explanation, '$planetName' AS planete_nom, url FROM $table WHERE explanation IS NOT NULL AND explanation != '' ORDER BY RAND($seed) LIMIT 3)";
} }
$unionQuery = implode(' UNION ALL ', $queries); $unionQuery = implode(' UNION ALL ', $queries);