In addition to the points cited in the other answers about the advantages of mysqli:
Object Oriented Interface (Object-oriented interface)
Support for Prepared Statements
Support for multiples Statements
Support for transactions (Transactions)
Improvement in debugging capacity
Support for embedded server
It is also necessary to note that the functions mysql_
no longer receive updates such as fixes and improvements and this is the vital point for you no longer to use the mysql_
, because in the future it will soon cease to exist for the new versions of PHP.
In other words, if you continue to function mysql_
, two situations can happen with your projects:
- There may be gaps in API security
mysql_
or bugs.
- When the API
mysql_
if disabled, your scripts will stop working, which will cause you a lot of headache as you will have to redo several codes.
Note that mysqli means Mysql Improved in Portuguese, it would be something like Improved Mysql, referencing the API and not the database system.
Answer
– Papa Charlie