Am working with neo4j database via this project below.
source GitHub - neo4j-php/neo4j-php-client: Php client and driver for neo4j database
Here is my code
<?php
require ('vendor/autoload.php');
$client = Laudis\Neo4j\ClientBuilder::create()
->addHttpConnection('backup', 'http://neo4j:foodisgood56@localhost')
->addBoltConnection('default', 'bolt://neo4j:foodisgood56@localhost')
->setDefaultConnection('default')
->build();
$query = $client->run('MATCH (n:Dept1) RETURN n LIMIT 25');
print_r($query );
/*
echo $json = json_decode($query, true);
foreach($json as $v1){
echo $v1['location'];
echo $v1['dname'];
echo $v1['deptno'];
}
*/
?>
when print a records in the array, i have the following output/records.
Ds\Vector Object ( [0] => Ds\Map Object ( [0] => Ds\Pair Object ( [key] => n [value] => Array ( [location] => Hyderabad [dname] => Accounting [deptno] => 10 ) ) ) [1] => Ds\Map Object ( [0] => Ds\Pair Object ( [key] => n [value] => Array ( [location] => Hyderabad1 [dname] => Accounting1 [deptno] => 11 ) ) ) [2] => Ds\Map Object ( [0] => Ds\Pair Object ( [key] => n [value] => Array ( [location] => Hyderabad2 [dname] => Accounting2 [deptno] => 12 ) ) ) )
Here is my issue
Please how, can I access or loop through the array and display values for location, dname and deptno