For initial contact
The POD extension is added to PHP5, which provides the php pdo class to access the database. Different databases use the same method name to solve the problem of inconsistent database connections.
Php pdo class goals
Provides a lightweight, clear, and convenient API
The common features of different RDBMS databases are unified, but more advanced features are not excluded.
PHP scripts provide optional abstract/compatibility.
Features of the php pdo class:
Performance. From the very beginning, PDO learned from the success and failure of existing database expansion. Because the PDO code is brand new, we have the opportunity to design performance again to take advantage of the latest features of PHP 5.
Capability. PDO is designed to provide common database functions as the basis and provide convenient access to the unique functions of RDBMS.
Simple. PDO is designed to make it easy to use databases. The API does not forcibly intervene in your code and clearly shows the process of calling each function.
It can be expanded during runtime. The PDO extension is modular, allowing you to load drivers at the backend of your database at runtime without re-compiling or re-installing the entire PHP program. For example, the PDO_OCI extension replaces the PDO extension to implement the oracle database API. There are also some drivers for MySQL, PostgreSQL, ODBC, and Firebird. More drivers are still under development. [Separator]
Install php pdo class
I am using the PDO extension developed in WINDOWS. If you want to install the configuration in Linux, go to other places to find it.
Version requirements: php5.1 and later versions are included in the program package; php5.0.x is to be downloaded from pecl.php.net and placed in your extension library, that is, the ext folder in the PHP folder; in the manual, versions earlier than 5.0 cannot run PDO extensions.
Configuration:
Modify Your php. ini configuration file to support pdo. (php. if you do not understand ini, first make it clear that you need to modify the php code displayed by calling your phpinfo () function. ini) Remove the semicolon before extension = php_pdo.dll, which is the annotation symbol of the php configuration file. This extension is required. Down
; Extension = php_pdo.dll
; Extension = php_pdo_firebird.dll
; Extension = php_pdo_informix.dll
; Extension = php_pdo_mssql.dll
; Extension = php_pdo_mysql.dll
; Extension = php_pdo_oci.dll
; Extension = php_pdo_oci8.dll
; Extension = php_pdo_odbc.dll
; Extension = php_pdo_pgsql.dll
; Extension = php_pdo_sqlite.dll
The databases corresponding to php pdo class extensions are:
Driver name Supported databases
PDO_DBLIB FreeTDS/Microsoft SQL Server/Sybase
PDO_FIREBIRD Firebird/Interbase 6
PDO_INFORMIX IBM Informix Dynamic Server
PDO_MYSQL MySQL 3.x/ 4.x
PDO_OCI Oracle Call Interface
PDO_ODBC ODBC v3 (IBM DB2, unixODBC and win32 ODBC)
PDO_PGSQL PostgreSQL
PDO_SQLITE SQLite 3 and SQLite 2
You only need to remove the annotator ";" before the corresponding extension to which database you want to use.