Welcome to the official
website of
Smokey Mountain Cup Tennessee
SCHEDULE
ABOUT
Scroll
to Discover
Welcome to the official
website of
Smokey Mountain Cup Tennessee
SCHEDULE
ABOUT
Scroll
to Discover
-------------------
function mostrarEquiposPorCategoria($conn) {
// Consulta para obtener categorías, grupos y equipos
$sql = "SELECT c.name AS categoria, g.name AS grupo, t.name AS equipo
FROM teams t
INNER JOIN group_teams gt ON t.id = gt.team_id
INNER JOIN groups g ON gt.group_id = g.id
INNER JOIN categories c ON g.category_id = c.id
ORDER BY c.name, g.name, t.name";
$result = $conn->query($sql);
// Almacenar los datos estructurados por categoría y grupo
$data = [];
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$categoria = $row['categoria'];
$grupo = $row['grupo'];
$equipo = $row['equipo'];
$data[$categoria][$grupo][] = $equipo;
}
}
// Generar la salida HTML
if (!empty($data)) {
foreach ($data as $categoria => $grupos) {
echo "
$categoria
";
foreach ($grupos as $grupo => $equipos) {
echo "
Get ready for the ultimate competition!
The Smokey Mountain Cup tournament is here, and we want you to be
part of the action. Join us for an event filled with excitement,
camaraderie, and top-notch soccer.
Leave us your info
and
we will get back to you.
Subscribe to the our
newsletter for soccer news.
Sign up using your e-mail to receive our newsletter.