From d9a2cd09d15892d7041de953a67deb872cc5e49c Mon Sep 17 00:00:00 2001 From: Whykioh Date: Mon, 2 Mar 2026 08:14:45 +0100 Subject: [PATCH] Fix delete game --- poker-paf/delete_game.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/poker-paf/delete_game.php b/poker-paf/delete_game.php index fb0d1d0..7288f6c 100644 --- a/poker-paf/delete_game.php +++ b/poker-paf/delete_game.php @@ -6,12 +6,11 @@ require_once 'db.php'; $game_id = isset($_SESSION['game_id']) ? $_SESSION['game_id'] : null; if ($game_id) { - $stmt = $db->prepare("DELETE FROM games WHERE id = :id"); - $stmt->execute([':id' => $game_id]); + $stmt = $db->prepare("DELETE FROM games WHERE id = ?"); + $stmt->execute([$game_id]); } else { - // Mode "Nettoyage" : on supprime la toute dernière entrée - $stmt = $db->prepare("DELETE FROM games ORDER BY id DESC LIMIT 1"); - $stmt->execute(); + echo "Aucune partie à supprimer."; + exit; } echo "La partie a bien été supprimée de la table poker_paf.";