【问题标题】:How to access data from orientdb on a PHP Page?如何在 PHP 页面上从 orientdb 访问数据?
【发布时间】:2015-12-18 11:06:21
【问题描述】:

我已经从https://github.com/orientechnologies/PhpOrient安装了OrientDb PHP官方驱动。

现在,在 PHP 页面中,我只希望它使用 print_r() 函数仅显示“用户”集合的属性值,例如 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

【问题讨论】:

  • 显示输出的代码如下:: $client = new PhpOrient('localhost', 2424); $client->用户名 = 'root'; $client->password = 'root'; $客户端->连接(); $ClusterMap = $client->dbOpen('krshop', 'root', 'root'); $data = $client->query('select from user limit 10'); echo "
    ";print_r($data);

标签: php database codeigniter orientdb


【解决方案1】:

试试这个代码:

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

【讨论】:

    猜你喜欢
    • 2019-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-22
    相关资源
    最近更新 更多