Introduction – A feature overview

MDB2 Description

PEAR MDB2 is a merge of the PEAR DB and Metabase php database abstraction layers.

It provides a common API for all support RDBMS. The main difference to most other database abstraction packages is that MDB2 goes much further to ensure portability. Among other things MDB2 features:

  • An OO-style query API

  • A DSN (data source name) or array format for specifying database servers

  • Datatype abstraction and on demand datatype conversion

  • Portable error codes

  • Sequential and non sequential row fetching as well as bulk fetching

  • Ability to make buffered and unbuffered queries

  • Ordered array and associative array for the fetched rows

  • Prepare/execute (bind) emulation

  • Sequence emulation

  • Replace emulation

  • Limited Subselect emulation

  • Row limit support

  • Transactions support

  • Large Object support

  • Index/Unique support

  • Module Framework to load advanced functionality on demand

  • Table information interface

  • RDBMS management methods (creating, dropping, altering)

  • Full integration into the PEAR Framework

  • PHPDoc API documentation

Currently supported RDBMS:

  • MySQL

  • MySQLi (PHP5 only)

  • PostgreSQL

  • Oracle

  • Frontbase (unmaintained)

  • Querysim

  • Interbase/Firebird (PHP5 only)


  • SQLite


When you install PEAR MDB2, you only get the base classes, but you also need to install the driver of the appropriate DBMS to have a working installation. For instance, to install the MySQL and the PostgreSQL drivers, you have to run these commands:

$ pear install MDB2

$ pear install MDB2#mysql

$ pear install MDB2#pgsql
Still having problems? Check the F.A.Q.

MDB2 (Previous) DSN (Next)
Last updated: Tue, 02 Jun 2009 — 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.