From c61d3df84405d831a4638cd1ac23a194ab79dca5 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Wed, 27 Sep 2023 15:40:43 +0200 Subject: [PATCH] foreachloop --- latestmatches.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/latestmatches.php b/latestmatches.php index 9a914c5..017ae48 100644 --- a/latestmatches.php +++ b/latestmatches.php @@ -29,9 +29,12 @@ error_reporting(E_ALL); // Display buttons for each player echo "
"; foreach ($players_matches as $player_data) { - $player_name = $player_data['playername']; - echo ""; + if (isset($player_data['playername'])) { + $player_name = $player_data['playername']; + echo ""; + } } + echo "

"; $selected_player = $_POST['selected_player'] ?? $players_matches[0]['playername'];