Connection to Couchbase Server N1QL query returns NULL


#1

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


#2

Hi @layerxfounder, I’m pretty sure 2.0.3 is not yet compatible with DP4, since it is quite brand new.

I think @brett19 can give you more info on the timeline when it will be available for you in PHP to test. You can already in .NET and Java ( see our blog posts for announcements on that front ).

Thanks,
Michael


#3

Your right. As Brett states it’s still a few weeks out. I did find a work around noted here:

Thanks

Keith