Question

In Neo4jPhp, to get the result we use

foreach ($result as $row) {
    echo $row['x']->getProperty('Name') . "<br>";
}

But when my query is

MATCH (n) RETURN count(n)

How to retrieve the result?

I tried

echo $row['x']->getProperty('0')

but it's not working. HOW TO GET THE COUNT RESULT as it do not have field name?

On using

echo $row['x']->getProperty('count(n)')<>

I get an error:

Fatal error: Call to a member function getProperty() on a non-object in D:\xampp\htdocs\abcd\index.php on line 17

Was it helpful?

Solution

Try changing your query to:

MATCH (n) RETURN count(n) AS c;

Then, try:

echo $row['c']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top