diff --git a/data/teams.db b/data/teams.db index e39bdfb..200a392 100644 Binary files a/data/teams.db and b/data/teams.db differ 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 @@