downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Mongo::getHosts> <Mongo::dropDB
[edit] Last updated: Fri, 23 Mar 2012

view this page in

Mongo::__get

(PECL mongo >=1.0.2)

Mongo::__getGets a database

Açıklama

public MongoDB Mongo::__get ( string $dbname )

This is the cleanest way of getting a database. If the database name has any special characters, Mongo::selectDB() will need to be used. However, in most cases, this should be sufficient.

<?php

$mongo 
= new Mongo();

// the following two lines are equivalent
$db $mongo->selectDB("foo");
$db $mongo->foo;

?>

Değiştirgeler

dbname

The database name.

Dönen Değerler

Returns a new db object.

Hatalar/İstisnalar

Throws a generic exception if the database name is invalid.



add a note add a note User Contributed Notes Mongo::__get
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites