fix caca error

This commit is contained in:
2026-03-03 20:14:06 +01:00
parent aff0a7d0b8
commit ccc5d505c3
+7
View File
@@ -35,6 +35,13 @@ try {
$stmt = $db->prepare("UPDATE games SET last_bet = 0 WHERE id = ?");
$stmt->execute([$game_id]);
// 7. Récupérer le nom du gagnant pour l'afficher
$stmt = $db->prepare("SELECT name FROM players WHERE id = ?");
$stmt->execute([$winner_id]);
$winner = $stmt->fetch(PDO::FETCH_ASSOC);
echo json_encode(['success' => true, 'winner_name' => $winner['name'] ?? "Inconnu"]);
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
}