PHP code example of phpinnacle / cassis
1. Go to this page and download the library: Download phpinnacle/cassis 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/ */
phpinnacle / cassis example snippets
use Amp\Loop;
use PHPinnacle\Cassis\Cluster;
use PHPinnacle\Cassis\Session;
use PHPinnacle\Cassis\Statement;
/
$session = yield $cluster->connect('system');
$statement = new Statement\Simple('SELECT keyspace_name, columnfamily_name FROM schema_columnfamilies');
$result = yield $session->execute($statement);
foreach ($result as $row) {
printf("The keyspace %s has a table called %s\n", $row['keyspace_name'], $row['columnfamily_name']);
}
$session->close();
});
bash
CASSIS_EXAMPLE_DSN=tcp://user:pass@localhost:9042 php example/*