MySQL Database extensions for PHP

PHP provides three different MySQL Database extensions.
1) Mysql
2) PDO MySQL
3) Mysqli

A table-wise comaprison of MySQL Database extensions is available at the following link.
http://php.net/manual/en/mysqli.overview.php

 

1) Mysql
This is the original MySQL API. Available for PHP versions 4 and 5, this extension is intended for use with MySQL versions prior to MySQL Server v4.1.3. It provides a procedural interface and does not support all features of the latest MySQL Servers.
This extension is deprecated as of PHP v5.5.0, and is not recommended for writing new code as it will be removed in the future.
http://php.net/manual/en/book.mysql.php

 

2) PDO MySQL
PDO stands for PHP Data Objects. Available as of PHP v5.1.0, this extension is intended for use with MySQL Server v3.x and later. It will take advantage of native prepared statement support present in MySQL Server v4.1 and higher. If we are using an older version of the mysql client libraries, PDO will emulate them for us. While it offers a  clean, simple, portable API, it does not allow you to use all of the advanced features that are available in the latest versions of MySQL Server.
This extension does not expose an API to the PHP programmer, but provides an interface to the PDO layer above it. It sits in the layer below PDO itself, and provides MySQL specific functionality.
http://php.net/manual/en/ref.pdo-mysql.php

 

3) Mysqli
Mysqli stands for MySQL Improved. Available as of PHP v5.0.0, this extension is intended for use with MySQL Server v4.1.1 and later. It fully supports the authentication protocol used in MySQL Server v5.0, as well as the Prepared Statements and Multiple Statements APIs. It provides both procedural interface and the advanced, object-oriented programming interface.
http://php.net/manual/en/book.mysqli.php

 

 

 

You may go back to the following section.
Installing PHP