Add create asset functionality to API

This commit is contained in:
Marcus Hill
2022-02-27 16:09:21 +00:00
parent 90f62cecaa
commit 4b077cf6e0
5 changed files with 172 additions and 68 deletions

View File

@@ -1,21 +1,26 @@
<?php
// Output (to be included)
/*
* API - read_output.php
* Included on calls to read.php endpoints
* Returns success & data messages
*/
if($sql && mysqli_num_rows($sql) > 0){
$return_arr['success'] = "True";
$return_arr['count'] = mysqli_num_rows($sql);
$return_arr['success'] = "True";
$return_arr['count'] = mysqli_num_rows($sql);
$row = array();
while($row = mysqli_fetch_array($sql)){
$return_arr['data'][] = $row;
}
$row = array();
while($row = mysqli_fetch_array($sql)){
$return_arr['data'][] = $row;
}
echo json_encode($return_arr);
exit();
echo json_encode($return_arr);
exit();
}
else{
$return_arr['success'] = "False";
$return_arr['message'] = "No resource for this company with the specified parameter(s).";
echo json_encode($return_arr);
exit();
$return_arr['success'] = "False";
$return_arr['message'] = "No resource (for this company) with the specified parameter(s).";
echo json_encode($return_arr);
exit();
}