PHP code example of christianascone / php-orientdb-http

1. Go to this page and download the library: Download christianascone/php-orientdb-http library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

christianascone / php-orientdb-http example snippets


$parameters = christianascone\OrientDB\Binding\BindingParameters::create('http://admin:[email protected]:2480/demo');
$orient = new christianascone\OrientDB\Binding\HttpBinding($parameters);
$output = $orient->query("SELECT FROM Address");

foreach ($output->getResult() as $address) {
    var_dump($address->street);
}

use christianascone\OrientDB\Query\Query;

$query = new Query();
$query->from(array('users'))->where('username = ?', "admin");

echo $query->getRaw();      // SELECT FROM users WHERE username = "admin"

use christianascone\OrientDB\Query\Command\Select;

$select = new Select(array('users'));
echo $select->getRaw();     // SELECT FROM users

php ./test/Integration/fixtures/load.php