<?php include('includes/config/config.php'); $itemId = $_REQUEST['item_id']; $batch = $_REQUEST['item_batch_no']; error_log("item_id".$item_id." ".$batch); $query = "select stock_qty from checklist_item_stock where item_id = '" . $item_id . "' and item_batch_no = '" . $batch . "' "; error_log("fetching stock:" . $query); if (!$result = @mysqli_query($conn,$query)) { error_log("error in fetching stock:" . $query); } $data = array(); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $data = $row['stock_qty']; } } else { $data['status'] = 200; $data['message'] = "Data not found!"; } echo json_encode($data); ?>