The Mongo class
Wstęp
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
?>
Krótki opis klasy
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 */
__construct
([ string $server = NULL
[, boolean $connect = TRUE
[, boolean $persistent = FALSE
[, boolean $paired = FALSE
]]]] )
}Spis treści
- Mongo::close — Closes this database connection
- Mongo::connect — Connects to a database server
- Mongo::connectUtil — Connects with a database server
- Mongo::__construct — Creates a new database connection object
- Mongo::dropDB — Drops a database
- Mongo::forceError — Creates a database error on the database [deprecated]
- Mongo::lastError — Check if there was an error on the most recent db operation performed [deprecated]
- Mongo::pairConnect — Connects to paired database server
- Mongo::pairPersistConnect — Creates a persistent connection with paired database servers
- Mongo::persistConnect — Creates a persistent connection with a database server
- Mongo::prevError — Checks for the last error thrown during a database operation [deprecated]
- Mongo::resetError — Clears any flagged errors on the connection [deprecated]
- Mongo::selectCollection — Gets a database collection
- Mongo::selectDB — Gets a database
- Mongo::__toString — String representation of this connection
Mongo
There are no user contributed notes for this page.
