Home  >  Article  >  Database  >  PDO overview features and installation

PDO overview features and installation

黄舟
黄舟Original
2017-02-25 10:29:291593browse

PDO Overview:

PDO is the abbreviation of PHP Data Object (PHP Data Object), which is released together with PHP5.1 version. Currently supported databases include Firebird, FreeTDS, Interbase, MySQL, MS SQL Server, ODBC, Oracle, Postgre SQL, SQLite and Sybase. With PDO, users no longer need to use mysql_* functions, oci_* functions or mssql_* functions, nor do they need to encapsulate database operation classes for them. They only need to use the methods in the PDO interface to operate the database. When selecting a different database, you only need to modify the DSN (database source name) of PDO.

PDO features:

PDO is a database access abstraction layer that unifies the access interfaces of various databases and interacts with mysql and mysqli functions Compared with libraries, PDO makes cross-database use more friendly; compared with ADODB and MDB2, PDO is more efficient.

PDO will unify the common features of various RDBMS libraries through a lightweight, clear, and convenient function to achieve the abstraction and compatibility of PHP scripts to the greatest extent.

PDO absorbs the experience and lessons of existing database expansion and can easily interact with various databases.

The PDO extension is modular, enabling users to load drivers for the database backend at runtime without having to recompile or reinstall the entire PHP

For example: PDO_MySQL will replace the PDO extension implementation MySQL database API.

Install PDO:

PDO cannot be used in versions prior to php5.

To enable PDO in window, you can remove the semicolon in front of extension=php_pdo.dll in php.ini. If you want to support MySQL database, you need to remove extension The semicolon in front of =php_pdo_mysql.dll

Note: PDO is enabled by default in some versions above 5.2.

The above is the overview of PDO features and installation content. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn