Question : php and mysql

There are 3 method's by which PHP script is used to connect to MySQL
1)MySQL Extension
2)MySQLi Extension
3)PHP Data Objects (PDO)


1)Can the experts list me the advantages & disadvantages of these 3 method's.
2)And which method is good to use.


Note:- No googled links please

Answer : php and mysql

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.    
Random Solutions  
 
programming4us programming4us