MDB::connect()

MDB::connect() -- connects to database

Synopsis

require_once 'MDB.php';

object MDB::connect (string $dsn, boolean [$options = FALSE])

Описание

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

Параметр

string $dsn

Data Source Name. See the "DSN" section for further information.

boolean $options

If $options is TRUE the connection will be persistent (requires support by database driver). Default is FALSE. In future releases, this parameter will be an array and take different options depending on the database.

Возвращаемое значение

object - the created MDB connection object, or a MDB_Error object on error.

Throws

Таблица 34-1. Возможные значения PEAR_Error

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

Заметка

Эта функция должна вызываться статически.

См. также

MDB::disconnect() , Tutorial - Connect()


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ