您好,欢迎访问一九零五行业门户网

php开发Hive Web查询

$globals['thrift_root'] = '/data/center_a0001/www/libs/classes/thrift/';
require_once $globals['thrift_root'] . 'packages/hive_service/thrifthive.php';
require_once $globals['thrift_root'] . 'transport/tsocket.php';
require_once $globals['thrift_root'] . 'protocol/tbinaryprotocol.php';
$transport = new tsocket('127.0.0.1', 10000);
$protocol = new tbinaryprotocol($transport);
$client = new thrifthiveclient($protocol);
$transport->open();
$client->execute('use fycenter');
$sql = 'select * from orders '.$wheregame.' order by `time` desc';
$client->execute($sql);
$result=$client->fetchall();
$arrlist = array();
foreach ($result as $k=>$v) {
$arrtemp = explode(\t, $v);
$arrlist[$k]['accountname'] = $arrtemp[0];
$arrlist[$k]['rolename'] = $arrtemp[1];
$arrlist[$k]['ordernumber'] = $arrtemp[2];
$arrlist[$k]['money'] = $arrtemp[3];
$arrlist[$k]['moneytype'] = $arrtemp[4];
$arrlist[$k]['moneyrmb'] = $arrtemp[5];
$arrlist[$k]['coin'] = $arrtemp[6];
$arrlist[$k]['time'] = $arrtemp[7];
$arrlist[$k]['isfirst'] = $arrtemp[8];
}
$smarty->assign('user_list',$arrlist);
$smarty->display('gen_user_table.html');
其它类似信息

推荐信息