getInfo.php 463 B

12345678910111213141516
  1. <?php
  2. if (isset($_POST["id"])) {
  3. include("../connectSQL_Component.php");
  4. $id = $_POST["id"];
  5. $result = [];
  6. $sql = "SELECT [title],[dir_name],[description] FROM [BIMComponents].[dbo].[Video_Table] WHERE [id] = " . $id . ";";
  7. $fetchResult = sqlsrv_query($conn, $sql);
  8. while ($row = sqlsrv_fetch_array($fetchResult, SQLSRV_FETCH_ASSOC)) {
  9. array_push($result, $row);
  10. }
  11. echo json_encode($result);
  12. sqlsrv_close($conn);
  13. }