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

search for in the

Mongo::close> <Examples
Last updated: Fri, 20 Nov 2009

view this page in

The Mongo class

Introduction

The connection point between MongoDB and PHP.

This class is used to initiate a connection and for database server commands. A typical use is:

<?php

$m 
= new Mongo(); // connect
$db $m->selectDatabase(); // get a database object

?>

Class synopsis

Mongo
Mongo {
/* Constants */
string $VERSION ;
string $DEFAULT_HOST = "localhost" ;
int $DEFAULT_PORT = 27017 ;
/* Fields */
public boolean $connected = FALSE ;
protected string $server = localhost:27017 ;
protected string $username = "" ;
protected string $password = "" ;
protected boolean $paired = FALSE ;
protected boolean $persistent = FALSE ;
public $connection = NULL ;
/* Methods */
public boolean close ( void )
public boolean connect ( void )
protected boolean connectUtil ( string $username , string $password )
__construct ([ string $server = NULL [, boolean $connect = TRUE [, boolean $persistent = FALSE [, boolean $paired = FALSE ]]]] )
public array dropDB ( mixed $db )
public bool forceError ( void )
public array lastError ( void )
public boolean pairConnect ( void )
public boolean pairPersistConnect ([ string $username = "" [, string $password = "" ]] )
public boolean persistConnect ([ string $username = "" [, string $password = "" ]] )
public array prevError ( void )
public array resetError ( void )
public MongoCollection selectCollection ( string|MongoDB $db , string $collection )
public MongoDB selectDB ( string $dbname )
public string __toString ( void )
}

Table of Contents



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

Mongo::close> <Examples
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites