Categories: MySQLDevelopment | PHP

PHP PDO MYSQL


Contents

[edit] Introduction

PDO_MYSQL is the MySQL driver for PDO (PHP Data Objects). Under the name PDO_MYSQLND a patch which allows to compile PDO_MYSQL against the MySQL native driver for PHP (mysqlnd) or the mysql client library (like ever since) has been developed.

The patch has been checked into the php.net CVS repository on 21.07.2008 and applied to PHP 5.3 (current development branch) and PHP 6.0 (HEAD). Consequently, you can download the latest version from http://www.php.net. Source snapshots, are available at http://snaps.php.net/, Windows builds of these snapshots from http://windows.php.net/snapshots. Check http://www.php.net/anoncvs.php for Anonymous CVS Access.

The MySQL native driver (mysqlnd) for PHP is an optimized drop-in replacement for the MySQL client library (libmysql). The MySQL native driver for PHP has proven its compatibility, stability and excellent performance as an optional backend library of the MySQL flagship PHP Connector ext/mysqli. As of PHP 5.3 all PHP extensions using MySQL (ext/mysql, ext/mysqli, PDO_MYSQL) use mysqlnd as a default.

[edit] Advantages

PDO_MYSQL inherits all benefits of the MySQL native driver for PHP:

[edit] Features and Limitations

The patch has been applied to the PHP 5.3 and PHP 6.0 CVS branches. You must use PHP 5.3 or newer. When compiling PDO_MYSQL against mysqlnd (default), you cannot connect to any MySQL Server < 4.1 . If you want to connect to MySQL < 4.1, you have to compile PDO_MYSQL against the mysqlclient library, as you did in the past. However, please note the MySQL Lifecycle Policy.

[edit] Status and target audience

The PDO_MYSQLND patch has reached beta status before it was applied to PDO_MYSQL. The patched version of PDO_MYSQL, contained in the php.net CVS repository, has solved at least the following bugs:

However, PHP 5.3 has not been released as GA version and is only available as release candidate. Therefore, you should not yet use PHP 5.3 and the included PDO_MYSQL, in production environments.

The number of tests has been increased greatly during the development. We routinely run the tests on more than 25 different platforms to ensure quality.

[edit] Releases

Please mind: PHP 5.3 and PDO_MYSQL are released by php.net. Only major milestones of PDO_MYSQL are listed here. For full information on PHP releases please check http://php.net.

[edit] Installation

1. Get a source distribution of PHP 5.3

Download a source distribution of PHP 5.3 from :http://snaps.php.net/ or check out PHP from CVS. See :http://php.net/anoncvs.php for Anonymous CVS Access instructions.
> cvs -d :pserver:cvsread@cvs.php.net:/repository checkout -r PHP_5_3 php5
> cd php5/

2. Build PHP with PDO_MYSQLND support

Rebuild the PHP configure scripts and build PHP with PDO_MYSQLND support.
php5> ./buildconf --force
php5> ./configure --with-pdo-mysql=mysqlnd
php5> make clean
php5> make

[edit] Known/reported Bugs

Please check bugs.php.net for bugs. If you are an Open Source user, please report issues at bugs.php.net.

[edit] Community improvement requests

It would be nice to have better support for stored procedures which seems to work strange or maybe the topic on how to use them isn`t well described/documented. I`m talking about OUT/INOUT params which is hard to get/use in PHP code and multiple calls of sp in one script. After each call the db connection must be set again., Mark in response to the blog posting PHP: PDO_MYSQLND 1.0.2-alpha released

General PDO requests should be collected on the PHP project wiki. See Requests for Comments: PDO version 1 improvements.

[edit] Roadmap

PDO_MYSQL offers all planned features. We focus on maintenance and bug fixing.

[edit] Contact

To discuss PDO_MYSQLND, please use our PHP Forum. You may also contribute to the MySQL PHP mailing list.

[edit] Related Links

Retrieved from "http://forge.mysql.com/wiki/PHP_PDO_MYSQL"

This page has been accessed 18,632 times. This page was last modified 15:13, 4 September 2009.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...