$entry, 'last_modified' => $last_modified ]; } } closedir($handle); } } // Fetch leagues from the database $leagues = []; $query = "SELECT league_id, league_name FROM leagues"; if ($result = $conn->query($query)) { while ($row = $result->fetch_assoc()) { $leagues[] = $row; } } ?>