namedParams()
namedParams(array $params) : \Couchbase\N1qlQuery
Specify associative array of named parameters
The supplied array of key/value pairs will be merged with already existing named parameters.
Note: carefully choose type of quotes for the query string, because PHP also uses $
(dollar sign) for variable interpolation. If you are using double quotes, make sure
that N1QL parameters properly escaped.
Parameters
Returns
\Couchbase\N1qlQuery
Examples
<?php
$query = CouchbaseN1qlQuery::fromString('SELECT airportname FROM `travel-sample` WHERE city=$city AND type=$airport');
$query->namedParams(['city' => "Los Angeles", 'type' => "airport"]);