![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
php终于有了自己的内置的数据库抽象层类包了.
PHP 5.1 Release Candidate 1 Available
[8-Aug-2005] PHP 5.1 Release Candidate 1 is now available! If all goes well, this RC will be followed by a release within a
couple of weeks.
Some of the key improvements of PHP 5.1 include:
- PDO (PHP Data Objects) - A new native database abstraction layer providing performance, ease-of-use, and flexibility.
PDO(PHP Data Objects) - php5.1最增的数据库抽象层用于提供对数据库访问的对象,拥有良好的性能,易于使用和灵活性的特点.
- Significantly improved language performance mainly due to the new Zend Engine II execution architecture.
- The PCRE extension has been updated to PCRE 6.2.
- Many more improvements including lots of new functionality & many bug fixes, especially in regards to SOAP, streams and
SPL.
- See the bundled NEWS file for a more complete list of changes.
[/list=1]
Everyone is encouraged to download and test this beta, although it is not yet recommended for mission-critical production
use.
*********************************************************
简介
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.
在php中PDO 是一个轻量级的数据库访问抽象层,提供对数据库访问一致的接口。每一个数据库驱动访问接口均被实现封装在PDO相应的接口方
法中,通过一系列正规的扩展方法去表现各种数据库的差异。需要注意的是,你不能通过使用数据库函数去实现PDO的扩展。你必要使用针对每
一个数据库PDO去访问数据库服务器。
(在php5.1中有多个PDO的dll文件,根据你的需要选择适合的去加载)
安装
Windows环境
Follow the same steps to install and enable the PDO drivers of your choice.
使用如下相同步骤去安装激活你选择的PDO驱动。
Windows users can download the extension DLL php_pdo.dll as part of the PECL collection binaries from /downloads.php or a
more recent version from a PHP 5 PECL Snapshot.
Windows用户可以从php.net上或最近的PHP 5 PECL Snapshot下载作为PECL容器二进制扩展DLL文件的php_pdo.dll等一系列文件。
To enable the PDO extension on Windows operating systems, you must add the following line to php.ini: extension=php_pdo.dll
在WINDOWS操作系统中激活PDO的扩展,你需需要在php.ini中加入 extension=php_pdo.dll
Next, choose the other DB specific DLL files and either use dl() to load them at runtime, or enable them in php.ini below
php_pdo.dll.
然后,选择相应的DB的DLL文件或者在程序中使用DL()函数去加载。
For example: extension=php_pdo.dll
extension=php_pdo_firebird.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
These DLLs should exist in the system's extension_dir. (这些文件在X:\php\ext文件夹中)
(但是我好像没有找到php_pdo.dll文件,我直接加载php_pdo_mysql.dll也可以。)
Linux and UNIX环境
1. bash$ wget http://pecl.php.net/get/PDO
2. export PATH="/usr/local/php5/bin
PATH"
3.
bash$ tar xzf PDO-0.9.tgz
bash$ cd PDO-0.9
bash$ phpize
bash$ ./configure
bash$ make
bash$ sudo -s
bash# make install
bash# echo extension=pdo.so >> /usr/local/php5/lib/php.ini
其它的东西,如何使用,等我先测试一下再说.
提问者:stangly_wrong 08-18 08:08
答复

