Closed sfdreverman closed 8 years ago
Should this work?
return $this->neo4j->sendCypherQuery('MATCH (n:{ myType }) RETURN n ORDER BY n.name',['myType' => $myParam]);
Where $this is the php neo4j object and $myParam is the parameter passed into the function.
Because if it does, this will give an error message at position 10 (the { in the query). So my suspicion is that the parameter is not parsed.
Sorry for not seeing this, I haven't been notified :(
So, no this will not work, because Cypher doesn't accept dynamic labels, main reason is query caching.
Should this work?
return $this->neo4j->sendCypherQuery('MATCH (n:{ myType }) RETURN n ORDER BY n.name',['myType' => $myParam]);
Where $this is the php neo4j object and $myParam is the parameter passed into the function.
Because if it does, this will give an error message at position 10 (the { in the query). So my suspicion is that the parameter is not parsed.