Web site layout - 556 CHAPTER 23 INTRODUCING PDO Figure 23-1.
556 CHAPTER 23 INTRODUCING PDO Figure 23-1. Using a database abstraction layer to decouple the application and data layers It s likely you ve heard of some of the more widespread implementations, a few of which are listed here: DB: DB is a database abstraction layer written in PHP and available as a PEAR package. (See Chapter 11 for more information about PEAR.) It presently supports FrontBase, InterBase, Informix, Mini SQL, MySQL, Oracle, ODBC, PostgreSQL, SQLite, and Sybase. JDBC: As its name implies, the Java Database Connectivity (JDBC) standard allows Java programs to interact with any database for which a JDBC driver is available. Among others, this includes MSSQL, MySQL, Oracle, and PostgreSQL. ODBC: The Open Database Connectivity (ODBC) interface is one of the most widespread abstraction implementations in use today, supported by a wide range of applications and languages, PHP included. ODBC drivers are offered by all mainstream databases, including those referenced in the above JDBC introduction. Perl DBI: The Perl Database Interface module is Perl s standardized means for communicating with a database, and was the inspiration behind PHP s DB package. As you can see, PHP offers DB and supports ODBC; therefore, it seems that your database abstraction needs are resolved when developing PHP-driven applications, right? While these (and many other) solutions are readily available, an even better solution has been in development for some time, and has been officially released with PHP 5.1. This solution is known as the PHP Data Objects (PDO) abstraction layer. Another Database Abstraction Layer? As PDO came to fruition over the past two years, it was met with no shortage of rumblings from developers either involved in the development of alternative database abstraction layers, or
In case you need quality webspace to host and run your web applications, try our personal web hosting services.