<?php
include("../sql.php");
$connectionInfo = array("Database" => "$dbname", "UID" => "$username", "PWD" => "$password", "CharacterSet" => "UTF-8");
$conn = sqlsrv_connect($hostname, $connectionInfo);
if ($conn === false) {
    die(print_r(sqlsrv_errors(), true));
}
$data = array();
$id = $_POST["id"];
$sql = "SELECT [category_name] FROM [Construction_Category] WHERE [category_id] = ?";


$fetchResult = sqlsrv_query($conn, $sql, array($id));
while ($row = sqlsrv_fetch_array($fetchResult)) {
    array_push($data, $row);
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
