Home > Article > Backend Development > What are the differences between MySQL, MySQLi and PDO in php?
The differences between MySQL, MySQLi and PDO in php are: 1. mysql is a non-persistent connection function and mysqli is a permanent connection function; 2. mysqli is a new function library provided by php5, [i] means improvement, and The execution speed is faster and safer; 3. PDO supports more advanced DB feature operations.
The differences between MySQL, MySQLi and PDO in php are:
1. MySQL extension of PHP
#Design and develop early extensions that allow PHP applications to interact with MySQL databases. The mysql extension provides a procedure-oriented interface;
and is designed for MySQL4.1.3 or earlier. Therefore, although this extension can interact with MySQL 4.1.3 or newer database servers, it does not support some features provided by later MySQL servers.
mysqli extension, which we sometimes call MySQL enhanced extension, can be used For using the new advanced features in MySQL 4.1.3 or later;
mysqli extension is included in PHP 5 and later versions;
mysqli Extensions have a series of advantages. Compared with MySQL extensions, the main improvements are: object-oriented interface, prepared statement support, multi-statement execution support, transaction support, enhanced debugging capabilities, and embedded service support.
PDO is truly a unified interface database operation implemented at the bottom layer Interface
PDO supports more advanced DB feature operations, such as storage procedure scheduling, etc., which is not supported by the mysql native library.
PDO is the official PECL library of PHP. Its compatibility and stability must be higher than MySQL Extension. You can directly use the pecl upgrade pdo command to upgrade.
The above is the detailed content of What are the differences between MySQL, MySQLi and PDO in php?. For more information, please follow other related articles on the PHP Chinese website!