Home  >  Article  >  Backend Development  >  Note 001 Introduction, installation and configuration of PHP Data Object (PDO)

Note 001 Introduction, installation and configuration of PHP Data Object (PDO)

黄舟
黄舟Original
2016-12-26 09:26:381342browse

Introduction

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for PHP to access databases. Each database driver that implements the PDO interface can expose database-specific features as standard extensions.

PDO provides a data access abstraction layer, which means that no matter which database is used, the same functions (methods) can be used to query and obtain data.

PDO comes with PHP 5.1 and is used as a PECL extension in PHP 5.0. PDO requires the new OO features of PHP 5 core and therefore will not run on older versions of PHP.

Installation

1. Installing PDO

on a Unix system requires updating the php.ini file, setting extension=pdo.so to available, and enabling the specific database driver.

2. Install PDO on Windows system

Edit extension=php_pdo.dll in php.ini to be available, and enable specific database drivers, for example:

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

Those DLLs The file should exist in the system's extension_dir.

The above is the introduction, installation and configuration of Note 001 PHP Data Object (PDO). 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