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

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

黄舟
Release: 2023-03-04 08:48:01
Original
1349 people have browsed it

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
Copy after login

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 (m.sbmmt.com)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template