DB As DB Abstract Layer
Why database abstraction layer ?
A database abstraction layer is a database-independent interface, it is a layer of abstraction over the actual database access methods and allows developers to deal with different databases without changing their code on a per-database basis.
By placing a layer of abstraction between the database and the developer, the database abstraction layer insulates the programmer from database implementation details. If you initially write a script to talk directly to Oracle for example and later need to have it work with another database server, you will have to rewrite all the database-specific parts but If you use a database-independent API, then all you need is just to change some littel settings, Pear provide us DB data object that give us good features to accomplish this technque.
Now to the Examples