DB::connect()

DB::connect() -- Connects to a database

Áttekintés

object connect (mixed $dsn [, array $options = array()])

Leírás

Creates a new DB connection object and connect to the specified database

Paraméterek

string or array $dsn

Data Source Name. String formats are described in the DSN section while array formats are covered in the "Intro - Connect" section.

array $options

An optional argument can contain runtime configuration settings for this package. See setOption() for more information on the available settings.

Visszatérési érték

object - a new DB object or a DB_Error object on failure

Lehetséges hibaértékek

Táblázat 35-1. Lehetséges PEAR_Error visszatérési értékek

Error codeError messageReasonSolution
DB_ERROR_NOT_FOUND not found The database specific class was not found. Check the $dsn and make sure to have an complete installation of the DB-package and that you database is supported by DB.

Megjegyzés

Ez a függvény statikus meghívásra van felkészítve!

Lásd

disconnect(), "Intro - Connect"