PHP N1QL query returns NULL


#1

I originally had this question on the N1QL SDK Forum but I this its more of a PHP issue.

I have been able to connect the the cbq-engine via cbq cli tool and perform all types of queries. Its really cool. However when I try to use an sdk to to the same thing I see nothing but NULL as a result from the query.

Here is the sample code in php:
$COUCHBASE_SERVER = “http://172.31.19.145:8091”;
$COUCHBASE_N1QL_SERVER = “http://127.0.0.1:8093”;
$BUCKET = “PUBLIC_BUCKET”;
$SQL = “SELECT * FROM PUBLIC_BUCKET”;
try {
$cb = new CouchbaseCluster($COUCHBASE_SERVER,’’,’’);
$bucket = $cb->openBucket($BUCKET,’’);
$bucket->enableN1ql($COUCHBASE_N1QL_SERVER);
$query = CouchbaseN1qlQuery::fromString($SQL);
$res = $bucket->query($query);
var_dump($res);
}catch(CouchbaseException $e){
print_r($e);
}

I have PHP SDK 2.0.3 and N1QL DP4 all running on ubuntu 14.04

Please help.

Thanks Much


Connection to Couchbase Server N1QL query returns NULL
#2

Hey,

The PHP SDK does not currently support N1QL DP4. A release is expected on the first Tuesday of February to add support for the latest iteration of the N1QL DP.

Cheers, Brett


#3

Thanks Brett,

I dug through the code and see it’s making a REST call with CURL.
Easy to use that until the sdk is ready to go.

Thanks

Keith


#4

Hi Brett,

when do you plan to implement the new scan_consistency param? I’ve seen that it’s already supported in the java sdk.

Thanks,
Marcel


#5

Hey willewolle,

This ticket is tracking the implementation of that feature. I have scheduled to have it in the release next Tuesday!
https://issues.couchbase.com/browse/JSCBC-203.

Cheers, Brett