To understand the difference between MySQL, MySQLi, and PDO, we must know about each one of them individually.
These are nothing but the APIs of PHP that is used to access the MySQL databases and tables. The developers can choose either one of them for their project, however, it must be known that MySQLi cannot be used with PHP 7 and its newer versions. However, developers can use MySQLi with PHP 5, which is now deprecated.
Let’s have some more information about each of them:
- MySQL: This was the main extension that was designed to help PHP applications send and receive data from MySQL database. However, use of MySQL has been deprecated and removed as of PHP 7 and its newer versions. This is why it is not recommended for new projects, and that’s the reason why MySQLi and PDO extensions are used more nowadays.
- MySQLi: The ‘i’ in MySQLi stands for Improved. Therefore, this is also known as the improved version of MySQL. It has many new features that will be covered later in the article.
- PDO – PHP Data Objects: The main advantage of using PDO is that it supports, and provides a uniform method of access to 11 different databases.