<?php
include("connectSQL_Component.php");
if (isset($_GET["object"])) {    
    $name = $_GET["object"];    
    $table= [];
  
    $sql = "SELECT [APIName]
    ,[software]
    ,[detail]
    ,[operate]
    ,[type]
    ,[notes]
    ,[keyword]
    ,[object]
    ,[usage]
    ,[source]
    ,[version]
    ,[filePath]
    ,[webLink]
FROM [BIMComponents].[dbo].[API_Table] WHERE id = ?;";
    $fetchResult = sqlsrv_query($conn, $sql,array($name));    
    while ($row = sqlsrv_fetch_array($fetchResult)) {
        $table = $row;
    }   

    echo json_encode($table);
}

sqlsrv_close($conn);
