PHP N1QL query returns NULL

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:
try {
$cb = new CouchbaseCluster($COUCHBASE_SERVER,’’,’’);
$bucket = $cb->openBucket($BUCKET,’’);
$query = CouchbaseN1qlQuery::fromString($SQL);
$res = $bucket->query($query);
}catch(CouchbaseException $e){

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

Please help.

Thanks Much


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

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.



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.


Hey willewolle,

This ticket is tracking the implementation of that feature. I have scheduled to have it in the release next Tuesday!

Cheers, Brett