Different descriptions of mysql, mysqli, and PDO _ php Digest

Source: Internet
Author: User
PDO, MYSQL, and MYSQLI have better performance, normal mysql connections will certainly be discarded because every time SQL injection is prevented, and relatively slow mysql connections will certainly be discarded because every time SQL injection problems and relatively slow

Mysqli is an optimization made on the basis of common mysql. To be honest, the preprocessing method is successful, which completely solves the problem of SQL injection.
However, the only disadvantage is that it only supports mysql databases. if you do not operate other databases or, of course, this is undoubtedly the best choice.
PDO is the latest connection method compatible with most databases. it also solves SQL injection but also has some disadvantages. it only supports php5 and later versions. However, it is said that in the future, php6 only supports this connection.

PDO unifies all database abstraction layer object interfaces, and mysqli only unifies mysql's

To put it simply, PDO can perform operations on different databases using the same code. for example, if you migrate data from mysql to mssql, the program does not need to be modified.
While mysqli simply understands that mysql is not encapsulated.

In the case of high load, enabling persistent connections by PDO can produce a relatively stable "value" for the load ". However, the efficiency is not the highest.
Mysql is the fastest. Mysqli followed. Only mysql and mysqli are at high concurrency and high system load. Its load is also considerable. PDO does not.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.