Different introductions to mysql, mysqli, and PDO_PHP tutorial

WBOY
Release: 2016-07-21 15:16:07
Original
1249 people have browsed it

Ordinary mysql connections will definitely be abandoned because the problem of sql injection must be prevented every time and it is relatively slow

mysqli is an optimization based on ordinary mysql. To be honest, it is very successful in preprocessing. This method completely solves the problem of sql injection
But the only disadvantage is that it only supports mysql database. Of course, if you do not operate other databases or of course this is undoubtedly the best choice
PDO is the latest one. The connection method is compatible with most databases and solves SQL injection, but it also has shortcomings. It only supports versions above php5. However, I heard that only this kind of connection will be supported in php6 in the future.

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

To put it simply, PDO can implement the same code to operate different databases. For example, if you migrate from mysql to mssql, the program basically does not need to be changed
And mysqli simply understands the encapsulation of mysql. Good

Under high load conditions, PDO can obtain a relatively stable load "value" by enabling long connections. But the efficiency is not the highest.
mysql is the fastest. mysqli comes second. It’s just that mysql and mysqli are used when there is high concurrency and high system load. The load it carries is also considerable. PDO does not.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325969.htmlTechArticleOrdinary mysql connections will definitely be abandoned because SQL injection problems must be prevented every time and relatively speaking Mysqli is relatively slow. It is an optimization based on ordinary mysql. To be honest, it is very...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template