0) { while ($row_pending_item_expiry = mysqli_fetch_assoc($result_pending_item_expiry)) { //extract($row); $data = $row_pending_item_expiry; $data['expiry_date']=date_format(date_create($row_pending_item_expiry['expiry_date']),"d-M-Y "); } } else { $data['status'] = 200; $data['message'] = "Data not found!"; } echo json_encode($data);