<?php
require '../conex.php';
header('Content-Type: application/json');

$sql = "SELECT id, nombre FROM tb_destino WHERE condicion = 1 ORDER BY nombre";
$result = $conn->query($sql);

$destinos = [];
while ($row = $result->fetch_assoc()) {
  $destinos[] = [
    'id' => $row['id'],
    'nombre' => $row['nombre']
  ];
}

echo json_encode($destinos);
