Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require_once "./phpcassa/columnfamily.php";
// Create new ConnectionPool like you normally would
$pool = new ConnectionPool("KeyspaceName", array("127.0.0.1"));
// Retrieve a raw connection from the ConnectionPool
$raw = $pool->get();
$rows = $raw->client->execute_cql_query("SELECT * FROM ColumnFamily WHERE KEY = 1", cassandra_Compression::NONE);
// Return the connection to the pool so it may be used by other callers. Otherwise,
// the connection will be unavailable for use.
$pool->return_connection($raw);
unset($raw);
@tamilmani58

Hi,
How do I get counter column value using execute_cql_query? Since the value is by default stored as hex, result set couldn't recognize the value. I'm getting some weird symbols in the values column. Ex: ["value"]=> string(8) "�" (There is a value between the quotes, Copy paste in some editor) It looks like Hex Representation of 14, but I dunno what encoding it is.

@stevencorona

I'm not sure if counters are supported with CQL yet. Either way, you might have to use unpack('H*', $return) to convert from hex.

@tamilmani58

That worked :) Thank you :)
I found one more solution for the same coz I dint know "unpack"
http://itsallabtamil.blogspot.com
Regards
Tamil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.