ESH/getUnitByItemId.php

29 lines
651 B
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php
include ('includes/config/config.php');
include ('includes/functions.php');
$sql_item="select b.unit_name as unit_name from tbl_items a inner join unit_master b on a.unit_id=b.unit_id where item_id=".$_POST['item_id']." ";
if (!$result = @mysqli_query($conn,$sql_item)) {
exit(mysqli_error($conn));
echo json_encode("FAILURE");
}
else if(mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$data['unit_name']=$row['unit_name'];
}
}
else
{
$data['status'] = 200;
$data['message'] = "Data not found!";
}
echo json_encode($data);
?>