PDO offers a lightweight, consistent interface for accessing databases in PHP. PDO provides a data-access abstraction layer, which means that, regardless of which database you’re using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn’t rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility (like ADODB or Pear DB).
This means that you use the same functions to connect and query a MySQL database and a SQLite database (the only databases currently supported by PDO at DreamHost). This allows developers to code without worrying about the seperate commands for each database.
A couple of tutorials to get you started:
- First steps with PDO by Wez Furlong, developer of the extension
- Introduction to PDO (PowerPoint) by Ilia Alshanetsky, PHP developer
- Introduction to PHP 5 PDO at Sitepoint (Furlong’s comments)
- Connect PHP to DB2 and Cloudscape via PDO by Wez Furlong
- The PHP Data Object Abstraction Layer and Oracle by Wez Furlong
The last two tutorials is about DB2 and Oracle, which is currently not supported by the PHP setup at DreamHost, but the tutorials has lots of info, and you can always compile your own PHP, if you need to use it.