I am using Cassandra last few days. I am using PHPCassa library for that.
When I am trying to use the following code, Its not working correctly.
require_once('phpcassa/connection.php');
require_once "phpcassa/columnfamily.php";
// Create new ConnectionPool like you normally would
$pool = new ConnectionPool("newtest");
// Retrieve a raw connection from the ConnectionPool
$raw = $pool->get();
$rows = $raw->client->execute_cql_query("SELECT * FROM User WHERE KEY='phpqa'", cassandra_Compression::NONE);
echo "<pre>";
print_r($rows);
echo "<pre>";
// 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);
Its returning nothing, I have also tried following queries
$rows = $raw->client->execute_cql_query("SELECT * FROM User WHERE age='32'", cassandra_Compression::NONE);
$rows = $raw->client->execute_cql_query("SELECT * FROM User WHERE name='jack'", cassandra_Compression::NONE);
But When I tried
$rows = $raw->client->execute_cql_query("SELECT * FROM User", cassandra_Compression::NONE);
Its given the correct answer, displayed all the rows. Please advise me, how to use 'WHERE' properly.
Keyspace Details
Strategy Class: org.apache.cassandra.locator.SimpleStrategy
Strategy Options: None
Replication Factor: 1
Ring
Start Token: 6064078270600954295
End Token: 6064078270600954295
Endpoints: 127.0.0.1