//$query = "SELECT a.item_id,a.item_name,b.stock_qty FROM `tbl_items` a Left join item_stock_dispensary b on
//a.item_id = b.item_id where a.item_id = '".$itemId."' and b.ohc_location_id='" . $_SESSION['current_ohcttype'] . "' ";
$query="SELECT i.item_id, item_name, ifnull(d.stock_qty,0) as stock_qty, unit_id from tbl_items i left join (select item_id, stock_qty from item_stock_dispensary isd where ohc_location_id='".$_SESSION['current_ohcttype']."') d on i.item_id=d.item_id where i.item_id = '".$itemId."'";