infausys; // access collection $collection = $db->infausys; // execute query // retrieve all documents $cursor = $collection->find(); // iterate through the result set // print each document foreach ($cursor as $obj) { // call object by name and display echo 'Name: ' . $obj['name'] .' '.'Age : ' .$obj['age'].'
'; echo '
'; } // disconnect from server $conn->close(); // if error display error }catch (MongoException $e) { die('Error: ' . $e->getMessage()); } ?>