

The abstraction, however, is two-fold: one is widely known but less significant, while another is obscure but of most importance.Įveryone knows that PDO offers unified interface to access many different databases. PDO is a Database Access Abstraction Layer.
PHP TUTORIAL DRIVER
Following the mission of this site, this article will disprove various delusions and bad practices, while showing the right way instead.Īlthough this tutorial is based on mysql driver, the information, in general, is applicable for any driver supported.

Unlike those, this tutorial is written by someone who has used PDO for many years, dug through it, and answered thousands questions on Stack Overflow (the sole gold PDO badge bearer). As a result, half of PDO's features remain in obscurity and are almost never used by PHP developers, who, as a result, are constantly trying to reinvent the wheel which already exists in PDO. The only two exceptions are and, but they miss a lot of important information. There are many tutorials on PDO already, but unfortunately, most of them fail to explain the real benefits of PDO, or even promote rather bad practices. Getting data out of statement in dozens different formats.Running SELECT INSERT, UPDATE, or DELETE statements.
