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

$query = "SELECT idempresa AS id, razon_social AS nombre FROM tb_empresa WHERE condicion = 1";
$result = mysqli_query($conn, $query);

$data = [];
while ($row = mysqli_fetch_assoc($result)) {
    $data[] = $row;
}

echo json_encode($data);
