From 559d42fff18de27d0288bc62f614be1b19f30920 Mon Sep 17 00:00:00 2001 From: antux18 Date: Fri, 16 Feb 2024 10:55:10 +0100 Subject: [PATCH] =?UTF-8?q?Fin=20impl=C3=A9mentation=20ordre=20des=20?= =?UTF-8?q?=C3=A9nigmes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/teams.db | Bin 45056 -> 45056 bytes puzzles.php | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/teams.db b/data/teams.db index e39bdfb4123feff8722dac5985ae41e83c608681..200a3922428e8432d84b3ca8f916b1931cf7f9fd 100644 GIT binary patch delta 61 zcmZp8z|`=7X@WFk;zSu|)cif&bfPMujK*{49*j42&$y POw0@*z`FUrKVt#_S^W^l delta 55 zcmZp8z|`=7X@WFk*hCp;)-VRWtP2}c=Gt>JFfcIje`DbP&HrsPqrxkGPG%-%1_owE LW`@oG{TUMg=Y$W_ diff --git a/puzzles.php b/puzzles.php index 097d27e..64e8f5d 100644 --- a/puzzles.php +++ b/puzzles.php @@ -41,12 +41,12 @@ $stmt = $database->pdo_teams->prepare("SELECT pzorder FROM teams WHERE id == :id"); $stmt->bindValue(":id", $team_id); $stmt->execute(); - $order = $stmt->fetch(); - - echo (string) $order["pzorder"]; + $result = $stmt->fetch(); + $order = $result["pzorder"]; // Si un ordre d'énigmes n'a pas été défini au préalable pour cette équipe, on en choisit un au hasard : - if ($order == NULL) { + if (is_null($order)) { + echo "lol"; $order = rand(0, sizeof($pzorder)); $stmt = $database->pdo_teams->prepare("UPDATE teams SET pzorder = :order WHERE id == :id"); $stmt->bindValue(":id", $team_id); @@ -83,7 +83,7 @@