Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the difference between mysql, mysqli and PDO

Shulou Source: shulou.com Published: 2022-06-03 13:09:42 11月14日 Update

This article mainly talks about "what's the difference between mysql, mysqli and PDO". Interested friends might as well take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what's the difference between mysql, mysqli and PDO?"

Mysqli is an optimization based on ordinary mysql. To be honest, it is very successful that the preprocessing method completely solves the problem of sql injection.

But the only drawback is that it only supports mysql databases, of course, if you don't operate other databases, or of course, this is definitely the best choice.

PDO is the latest connection method that is compatible with most databases, but it also solves the problem of sql injection, but it only supports versions above php5, but I heard that it will only support this kind of connection in future php6.

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

To put it simply, PDO can implement the same code to operate on different databases. For example, if you migrate from mysql to mssql, the program does not need to be changed.

While mysqli can simply understand the encapsulation without mysql.

In the case of high load. PDO can get a relatively stable load "value" by opening a long connection. But the efficiency is not the highest.

Mysql is the fastest. Mysqli is the second. It's just that mysql and mysqli are in high concurrency and high system load. The load it bears is also considerable. PDO will not.

At this point, I believe you have a deeper understanding of "what is the difference between mysql, mysqli and PDO". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Data database support content method learning unity difference observability common deeper fastest highest success truth code interest just basics Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Huawei macOS Shulou Technology Docker