<?php
header('content-type:application/json');
include($_SERVER['DOCUMENT_ROOT'] . "/API/connection/conn.php");


$query = "SELECT * FROM document_types";
$result = mysqli_query($conn, $query);
$rowCount = mysqli_num_rows($result);
if ($rowCount > 0) {
    $postData = array();
    while ($row = mysqli_fetch_assoc($result)) {
        $postData[] = $row;
    }
}


$resultData = array('code' => $statusCode, 'message' => $statusMessage, 'data' => $postData);
echo json_encode($resultData);
