Different introductions of Mysql,mysqli,pdo _php Abstracts

Source: Internet
Author: User
The common MySQL connection must be discarded because every time you want to prevent SQL injection problems and relatively slow

Mysqli is an optimization based on common MySQL. Well, frankly, it's a success. Preprocessing completely solves the problem of SQL injection
But the only disadvantage is that the MySQL database is only supported, of course, if you don't operate any other databases or, of course, it's the best option.
PDO is the newest one. Compatible Most databases also solve SQL injection but there are drawbacks it only supports versions above PHP5 but I heard that in the future PHP6 only support this kind of connection

PDO unifies all database abstraction Layer object interfaces, mysqli only unifies MySQL's

Simply put, PDO can implement the same code for different database operations, such as your migration from MySQL to MSSQL, the program basically does not need to change
and mysqli simple understanding of the MySQL encapsulation is good

In the case of high load. PDO open long connection can get a relatively stable load "value". But efficiency is not the highest.
MySQL is the fastest. Mysqli second. Just MySQL and mysqli in high concurrency, high system load. The load it undertakes is also considerable. PDO is 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.