-added server files

This commit is contained in:
JailDoctor committed 2022-11-15 19:06:00 +01:00
1 parent ab1757f7cd
commit 32bdc6dcb6
8 files changed
+149 -2

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
class MiBD extends SQLite3
{
function __construct()
{
$this->open('../bd/jailgames.db');
}
}
$bd = new MiBD();
$game = "";
if (isset($_GET['game'])) $game = $_GET['game'];
$query = "SELECT user, points FROM scores WHERE game LIKE '".$game."' ORDER BY points DESC LIMIT 10";
$resultado = $bd->query($query);
$res = "";
$fila = $resultado->fetchArray(SQLITE3_ASSOC);
while ($fila) {
$res = $res.$fila['user'].",".$fila['points']."\n";
$fila = $resultado->fetchArray(SQLITE3_ASSOC);
}
echo($res);
?>