
PK 
<?php
ob_start();
//error_reporting(E_ALL ^ E_NOTICE);
@session_start();
ini_set('allow_url_include',1);
date_default_timezone_set("Asia/Kolkata");
set_time_limit(600);
ini_set('max_execution_time',600);
include '../includes/settings/constant.php';
//include '../includes/settings/db.php';
require_once '../includes/settings/PDODB.php';
include '../includes/modules/functions.php';
$function = new FUNCTIONS();
// Get the user id
$id = $_POST['id'];
// Database connection
if ($id !== "") {
// Get corresponding first name and
// last name for that user id
$pdodb = PDODB::getInstance();
$sql = "SELECT * from `inventory` where id='$id'";
$result = $pdodb->query($sql);
//echo $result; exit;
$itemCode = $result[0]["itemCode"];
$gstRate = $result[0]["gstRate"];
$hsnCode = $result[0]["hsnCode"];
$itemPrice = $result[0]["item_price"];
PDODB::closeInstance();
}
// Store it in a array
$result = array("$itemCode", "$gstRate", "$hsnCode", "$itemPrice");
//$result = array("Peter"=>35, "Ben"=>37, "Joe"=>43);
// Send in JSON encoded form
$result = json_encode($result);
echo $result;
?>


PK 99