Fix Quiz Self Hosting (1)
This commit is contained in:
+2
-1
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user