<?php
include "../../inc/inc.koneksi.php";

$kode	= $_POST['kode'];

$text	= "SELECT *	FROM stock WHERE kode_st= '$kode' GROUP BY kode_st ";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);

if ($row>0){
while ($r=mysql_fetch_assoc($sql)){
	$data['namast'] = $r[nama_st];
	$data['jmlstok'] = $r[jml_stok];
	$data['tsatuan'] = $r[satuan];
	echo json_encode($data);
}
}else{
	$data['namast'] = '';
	$data['jmlstok'] = '';
	$data['tsatuan'] = '';
	echo json_encode($data);
}
?>
