Chapter 16. Using PDO

Databases are important to any dynamic website. That's why we've had a lot to say about them in this book (too much, some of you may be thinking). However, PHP Data Objects (PDO) can't be ignored because they are packaged with PHP version 5.1 and higher, and they are "something many of the PHP dev team would like to see as the recommended API for database work."[*]

[*] www.zend.com/zend/week/week207.php#Heading6. (Accessed April 14, 2006.)

PDO is a data-access abstraction layer that aims for uniform access to any database. That's a pretty good reason for looking at PDO, but what interests us in particular is that the PDO interface is entirely object-oriented (OO). It makes extensive use of the OO improvements to PHP 5. In fact, it cannot be run on lower versions of PHP.

Drivers are available for all the major databases supported by PHP— Oracle, Microsoft SQL Server, PostgreSQL, ODBC, SQLite, and all versions of MySQL up to version 5. So, if you use a variety of different databases, PDO is especially worth investigating. However, even if you use only one database, PDO can be helpful for switching between versions. Be warned, though, that it is still early days for PDO, and some of the drivers may lack some functionality.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.9.236