The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
It is true that the MySQL extension is deprecated, and it is recommended to use either MySQLi or PDO instead.
MySQLi (MySQL improved) is an enhanced extension of MySQL. It was developed to take advantage of new features found in MySQL systems versions 4.1.3 and above. MySQLi is an object-oriented extension, while the original MySQL extension was not. This means that with MySQLi, you can use OOP techniques to write your code.
PDO (PHP Data Objects) is a database access layer that provides a uniform method of access to multiple databases. It provides a data-access abstraction layer, which means that, regardless of which database you are using, you use the same functions to issue queries and fetch data. This makes it easier to switch between databases if your application requires it.
Both MySQLi and PDO have their own benefits and drawbacks, and which one you should choose depends on your specific needs and preferences.