©
Dokumen ini menggunakan Manual laman web PHP Cina Lepaskan
(PECL mongo >=0.9.0)
MongoDB::selectCollection — Gets a collection
$name
)
name
The collection name.
Returns a new collection object.
Throws Exception if the collection name is invalid.
[#1] asuquo dot ulo at techxion dot com [2014-09-06 06:33:15]
A simple script that selects a db and collection.
$m = new MongoClient();
echo "Connection to database successfully<br>";
// select a database
$db = $m->test;
echo "Database test selected<br>";
//select a Collection
$collection = $db->selectCollection("member");
echo "Collection member selected succsessfully<br>";
?>