<?php

    require('../functions/conexion.php');

    $word = $_POST['word'];
    $i=0;

	$result = query("SELECT * FROM tipo_compras tc 
                    WHERE tc.is_active = 1");
    
    while($row = mysqli_fetch_assoc($result)){
        $rowdata[$i] = $row;
        $i++;
    }

    if ($i>0){
        $res =  json_encode($rowdata,JSON_UNESCAPED_UNICODE);
    } else {
        $res =  '[{"id":"0"}]';	
    }
    echo $res;
    
?>