Database Access with PHP Data Objects
While PHP has long supported most databases each one has been implemented as a separate extension with its own API. As a result supporting multiple databases has traditionally been difficult and the majority of PHP applications only support a single database.
First introduced in PHP 5 the PHP Data Objects (PDO) extension provides PHP with a data access abstraction layer, similar to Perls DBI or Pythons DB-API. This does not solve the problem of databases having different syntax but it does mean that programmers now only need to learn and use a single database API regardless of the database being used. PDO also supports prepared statements across all databases which reduces the risk of SQL injection attacks.
This presentation provides as an introduction to PDO for programmers who are still using database specific extensions. It will cover:
- What the PDO extension does and does not provide
- Using the PDO extension
- Writing database independent code with PDO
Keywords: PHP, PHP Data Objects, PDO, Data Access Abstraction Layer
Mr Richard Buggy
Founder, Zoombug
|
Ref: OS7P0034