MySQL vs MySQL vs PDO
The MySQLi Extension (MySQL Improved) is a relational database driver used in the PHP programming language to provide an interface with MySQL databases.
MySQLi is an improved version of the older PHP MySQL driver, offering various benefits.
The developers of the PHP programming language recommend using MySQLi when dealing with MySQL server versions 4.1.3 and newer (takes advantage of new functionality).
The mysqli extension is included with PHP versions 5 and later.
The MySQLi extension provides various benefits with respect to its predecessor, the most prominent of which are:
* An object-oriented interface
* Support for prepared statements
* Support for multiple statements
* Support for transactions
* Enhanced debugging support
* Embedded server support
The PDO MySQL driver extension, for example, does not expose an API to the PHP programmer, but provides an interface to the PDO layer above it.
PDO provides a consistent API for your PHP application regardless of the type of database server your application will connect to. In theory, if you are using the PDO API, you could switch the database server you used, from say Firebird to MySQL, and only need to make minor changes to your PHP code.
Other examples of database abstraction layers include JDBC for Java applications and DBI for Perl.
PDO is has a clean, simple, portable API, but its main disadvantage is that it doesn't allow you to use all of the advanced features that are available in the latest versions of MySQL server. For example, PDO does not allow you to use MySQL's support for Multiple Statements.