0

So I have been working around with neo4j and php-client graph aware, until now i have make it work kind of ok. Until now that i try to run a query returning a count() and can't find how to catch the information, the query that i run is the next function:

function net_in_common($user, $other){
    global $client;

    $searchquery = "MATCH (a:user)-[r:IN_NET]->(b:user)<-[s:IN_NET]-(c:user) WHERE a.username = '" . $user . "' AND c.username = '" . $other . "' return count(DISTINCT b) as incommon";

    $result = $client->run($searchquery);

    return $result;
}

but when i try to echo it by

$common = net_in_common($user1, $user2);
echo $common->value('incommon');

i get absolute and completely nothing, it even dispatch an error that break the php code but i can't find the mistake itself.

it's a different way of fetching the value of a count() or something that i should do different??

4

1 に答える 1