You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run the tests at the command line, issue composer install and then composer test at the package root. This requires composer to be available in $PATH.
The official JavaScript driver documentation has more details on the available terms. Most examples for the JavaScript driver can be translated to PHP-RQL with few changes.
Example
<?php// Load the driverrequire_once("rdb/rdb.php");
// Connect to localhost$conn = r\connect('localhost');
// Create a test tabler\db("test")->tableCreate("tablePhpTest")->run($conn);
// Insert a document$document = array('someKey' => 'someValue');
$result = r\table("tablePhpTest")->insert($document)
->run($conn);
echo"Insert: $result\n";
// How many documents are in the table?$result = r\table("tablePhpTest")->count()->run($conn);
echo"Count: $result\n";
// List the someKey values of the documents in the table// (using a mapping-function)$result = r\table("tablePhpTest")->map(function($x) {
return$x('someKey');
})->run($conn);
foreach ($resultas$doc) {
print_r($doc);
}
// Delete the test tabler\db("test")->tableDrop("tablePhpTest")->run($conn);
?>