如何在PHP页面上从orientdb访问数据?

时间:2015-12-18 11:06:21

标签: php database codeigniter orientdb

我已经从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);

User collection data using php of orientdb

1 个答案:

答案 0 :(得分:5)

试试这段代码:

$client = new OrientDB('localhost', 2424);
$client->connect('root', 'root');
$client->DBOpen('krshop', 'root', 'root');
$data = $client->select('select from user limit 10');