====== Database Abstraction Layers (DAL) pour Php ====== [[glossaire:DAL|Database Abstraction Layers (DAL)]] Voir aussi [[/informatique/php/ORM|Object Relational Mapping (ORM) pour PHP]]. ===== Implémentations ===== ==== PDO ==== http://fr.php.net/manual/en/book.pdo.php The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can expose database-specific features as regular extension functions. Note that you cannot perform any database functions using the PDO extension by itself; you must use a database-specific PDO driver to access a database server. PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility. PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0; PDO requires the new OO features in the core of PHP 5, and so will not run with earlier versions of PHP. Voir: * [[http://fr.php.net/manual/en/book.pdo.php|PDO Manual]] sur Php.net * [[http://julien-pauli.developpez.com/tutoriels/php/pdo/|Création d'objets métiers avec PDO]] * [[http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html|Introduction to PHP PDO]] (Tuto en anglais très complet et très pertinent) ==== DBX ==== http://fr.php.net/manual/en/book.dbx.php The dbx module is a database abstraction layer (db 'X', where 'X' is a supported database). The dbx functions allow you to access all supported databases using a single calling convention. The dbx-functions themselves do not interface directly to the databases, but interface to the modules that are used to support these databases. NOTE This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.1.0. ==== Unified ODBC ==== http://fr.php.net/manual/en/book.uodbc.php In addition to normal ODBC support, the Unified ODBC functions in PHP allow you to access several databases that have borrowed the semantics of the ODBC API to implement their own API. Instead of maintaining multiple database drivers that were all nearly identical, these drivers have been unified into a single set of ODBC functions. The following databases are supported by the Unified ODBC functions: "Adabas D", "IBM DB2", "iODBC", "Solid" and "Sybase SQL Anywhere". With the exception of iODBC, there is no ODBC involved when connecting to the above databases. The functions that you use to speak natively to them just happen to share the same names and syntax as the ODBC functions. However, building PHP with iODBC support enables you to use any ODBC-compliant drivers with your PHP applications. More information on iODBC, is available at » www.iodbc.org with the alternative unixODBC available at » www.unixodbc.org.