MDB::connect() – connects to database


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.

Return value

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


Possible PEAR_Error values
Error code Error message Reason Solution
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.


This function should be called statically.

Main class (Previous) checks for an error (Next)
Last updated: Tue, 24 Nov 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.