29 lines
651 B
PHP
29 lines
651 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)) {
|
|
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);
|
|
|
|
?>
|