PHP Data Objects (PDO)扩展是PHP中一个轻量级的、统一的数据接口。每种数据库依靠特定的正则函数驱动PDO接口,能反映出数据库特征。注意:你不能单独仅依靠PDO扩展来访问任何数据库;你必须使用特定数据库PDO驱动来访问数据库服务器。


PDO是在PHP5.1 中引入,也可以作为PHP5.0的PECL扩展;PDO需要PHP5核心中的新的面现对象特征,所以不能在以前的版本中运行。

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.

Published by 阿飞 on
Tags: php_pdo