我已经在 Hypertable 中插入了数据。但我不知道,如何从结果中获得特定的价值。我的 PHP 节俭代码是:
$GLOBALS['THRIFT_ROOT'] = "/opt/hypertable/0.9.5.6/lib/php";
require_once $GLOBALS['THRIFT_ROOT'].'/ThriftClient.php';
$client = new Hypertable_ThriftClient("localhost", 38080);
$namespace = $client->namespace_open("appuniv");
$query = "select * from category_details limit 1";
$tab = $client->hql_query($namespace, $query);
var_dump($tab);
我得到以下结果:
object(Hypertable_ThriftGen_HqlResult)#24 (4) { ["results"]=> NULL ["cells"]=> array(2) { [0]=> object(Hypertable_ThriftGen_Cell)#25 (2) { ["key"] => object(Hypertable_ThriftGen_Key)#26 (6) { ["row"]=> string(32) "077262cc53a1fb1b5f651d31b6bf81ba" ["column_family"]=> string(8) "category" ["column_qualifier"]=> string(4 ) "name" ["timestamp"]=> float(1.3419935154984E+18) ["revision"]=> float(1.3419935154984E+18) ["flag"]=> int(255) } ["value"]= > string(7) "Medical" } [1]=> object(Hypertable_ThriftGen_Cell)#27 (2) { ["key"]=> object(Hypertable_ThriftGen_Key)#28 (6) { ["row"]=> string( 32) “077262cc53a1fb1b5f651d31b6bf81ba”["column_family"]=> string(8) "category" ["column_qualifier"]=> string(4) "type" ["timestamp"]=> float(1.3419935154984E+18) ["revision"]=> float (1.3419935154984E+18) ["flag"]=> int(255) } ["value"]=> string(7) "android" } } ["scanner"]=> NULL ["mutator"]=> NULL 0.9678
我可以知道如何从上述结果中获取["value"]=> string(7) "Medical"值。