<?php
include '../config/conexion.php';
$res = $conexion->query("SELECT id, nombre FROM trabajadores ORDER BY nombre ASC");
$datos = [];
while ($row = $res->fetch_assoc()) {
    $datos[] = $row;
}
header('Content-Type: application/json');
echo json_encode($datos);
