ohctech_p8/getUnitByItemId.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

29 lines
650 B
PHP

<?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)) {
die(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);
?>