当我尝试使用以下代码时,它无法正常工作.
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);
它没有返回,我也尝试过以下查询
$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);
但是当我尝试的时候
$rows = $raw->client->execute_cql_query("SELECT * FROM User",cassandra_Compression::NONE);
给出正确答案,显示所有行.请告诉我,如何正确使用’WHERE’.
Keyspace细节
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