Aman Aasim
Aman Aasim

Reputation: 19

Get relationship type in a php variable of neo4j

What I want is that: I have two nodes with id 1 and id 2. It has a relationship type (id:1)-[r:Knows]->(id:2). My query is working fine in Neo4j as localhost but I am not able to store that relationship type in a PHP variable to use further. I am using graphware.

Note: $id = 1 and $s_id = 2.

$queryString = "MATCH (a:signup{iid:'$id'})-[r]->(b:signup{iid:'$s_id'}) return type(r) ";

$query = new Everyman\Neo4j\Cypher\Query($client, $queryString);

$result = $query->getResultSet();

if($result == 'Knows')
{
    $s_relation = $result;
}
else
{
    $s_relation = 'empty';
}

It returns the else part as EMPTY.

Thank you.

Upvotes: 0

Views: 91

Answers (1)

Aman Aasim
Aman Aasim

Reputation: 19

Well, I found a solution for this.

Upvotes: 0

Related Questions