PHP code example of tbolier / php-rethink-ql

1. Go to this page and download the library: Download tbolier/php-rethink-ql 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/ */

    

tbolier / php-rethink-ql example snippets



use TBolier\RethinkQL\Rethink;
use TBolier\RethinkQL\Connection\Registry;

$connections = [
    'default_connection' => [
        'host' => 'localhost',
        'port' => 28015,
        'default_db' => 'demoDB',
        'user' => 'demo',
        'password' => 'demo',
        'timeout' => 5,
        'timeout_stream' => 10,
    ],
];

$registry = new Registry($connections);

$r = new Rethink($registry->getConnection('default_connection'));

// Now you can connect to RethinkDB.
$r->connection()->connect();

$r->use('demoDB-2');

$r->db()
  ->tableCreate('Table')
  ->run();