Reputation: 642
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
Upvotes: 1
Views: 144
Reputation: 67019
Try changing your query to:
MATCH (n) RETURN count(n) AS c;
Then, try:
echo $row['c']
Upvotes: 3