Skip to content

Instantly share code, notes, and snippets.

@memorycraft
Created March 8, 2013 21:30
Show Gist options
  • Select an option

  • Save memorycraft/5120032 to your computer and use it in GitHub Desktop.

Select an option

Save memorycraft/5120032 to your computer and use it in GitHub Desktop.
<?php
//ライブラリのロード
require_once __DIR__."/lib/autoload.php";
//コネクションプールの使用
use phpcassa\Connection\ConnectionPool;
$pool = new ConnectionPool("Hogebook", array("10.0.1.10"));
//接続の取得
$raw = $pool->get();
//CQLクエリの発行
$rows = $raw->client->execute_cql_query("SELECT * FROM User", 2);
//結果の取得
$pool->return_connection($raw);
unset($raw);
//接続の解除
$pool->close();
//結果の表示
print_r($rows);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment