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

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

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

echo json_encode($transportes);
