我已经从https://github.com/orientechnologies/PhpOrient安装了OrientDb PHP官方驱动程序。
现在,在PHP页面中,我只是希望它只使用print_r()函数显示'user'集合的属性值,例如user_id,username,email_id,mobile等。
$client = new PhpOrient( 'localhost', 2424);
$client->username = 'root';
显示输出的代码如下::
$client->password = 'root';
$client->connect();
$ClusterMap = $client->dbOpen( 'krshop', 'root', 'root' );
$data = $client->query( 'select from user limit 10' );
echo "<pre>";print_r($data);
答案 0 :(得分:5)
试试这段代码:
$client = new OrientDB('localhost', 2424);
$client->connect('root', 'root');
$client->DBOpen('krshop', 'root', 'root');
$data = $client->select('select from user limit 10');