<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
//include ('includes/function.php');


$array    = '';
$zdb = $_SESSION["zdbyear_".$dbname];
mysqli_select_db($conn,$zdb);

if(isset($_REQUEST['name'])){
   $code   = mysqli_real_escape_string($conn,$_REQUEST["name"]);
//   BROWSE($code);
   $result = mysqli_query($conn,"SELECT `cost` , `selling` FROM  `item` WHERE `code`='$code'") or die(mysqli_error($conn));
   $array  = mysqli_fetch_object($result);
   header("Content-type: application/json");
   echo json_encode($array);
}
?>
