Chapter 3. MySQL
sports a new MySQL extension. While this extension is similar in
spirit to the original MySQL extension, it has many new features and
other improvements. To differentiate it from the original version,
this extension is called the “Improved MySQL
mysqli for short.
The changes to
come from two places. The majority are from new features available in
MySQL 4.1. However, PHP 5 also allows
mysqli to add an object-oriented interface.
Here’s a list of the major advances in
Compatibility with MySQL 4.1 and above
Prepared statements and bound parameters
Secure connections using SSL
Additionally, MySQL 4.1 has new SQL-level capabilities that you can use from PHP. They include:
Geospacial support (GIS)
On the downside, there are a few wrinkles if you want to start using
mysqli with your existing PHP projects:
Its client libraries are not bundled with PHP 5.
It does not work with MySQL 4.0 and below.
It’s missing some
a nutshell, if all your projects use MySQL 4.1 and later, and you
have no legacy MySQL code, then all you need to do is download the
MySQL client libraries and start using
the other hand, you’ll have some work to do if you:
Want to use MySQL 4.1, but have existing
Must write code that runs under MySQL 4.0 (and below) and 4.1 (and above)
Want to have some applications use a MySQL 4.0 database and others use ...