<?php

if (isset($_POST["id"])) {
    include("../connectSQL_Component.php");
    $id = $_POST["id"];
    $result = [];
    $sql = "SELECT [title],[dir_name],[description]  FROM [BIMComponents].[dbo].[Video_Table] WHERE [id] = " . $id . ";";
    $fetchResult = sqlsrv_query($conn, $sql);
    while ($row = sqlsrv_fetch_array($fetchResult, SQLSRV_FETCH_ASSOC)) {
        array_push($result, $row);
    }

    echo json_encode($result);

    sqlsrv_close($conn);
}
