Download presentation
Presentation is loading. Please wait.
Published byWinfred Warren Modified over 9 years ago
2
PEAR supplies a number of open source extensions to PHP including its DB package, which provides a database abstraction layer so that the PHP programmer doesn't have to worry about all the APIs for different databases.
3
Whether or not you decide to use PEAR DB or a similar database abstraction layer depends on your needs. If you need to be able to work on many applications and get your work done quickly, then PEAR DB is certainly helpful. If performance is key, then you may find the extra weight of PEAR DB to be prohibitive.
4
One big benefit of using a database abstraction layer like PEAR DB is portability. PEAR DB allows you to use a single API for working with many different types of databases. So if you decide to move to another database, you will not have to rewrite all your code.
5
Another benefit is code simplification. If your application involves multiple databases of different flavors or you work on many applications each of which uses a different type of database, you would normally have to learn the APIs for each of the databases you would be working with. Again, PEAR DB allows you to work with all these databases using the same API.
6
The biggest downside of using a database abstraction layer is that the benefits come at a performance cost. Imagine you were planning to travel around Europe and had the choice of bringing an interpreter who could speak all European languages and learning the languages yourself. It would certainly be easier to bring the interpreter, but this would make each conversation you had somewhat slower. The abstraction layer is the interpreter.
7
The connection string for connecting to the database with PEAR DB is: Syntax: driver://username:password@host/database
8
mysqli mysql mssql oci8 odbc pgsql sybase dbase sqlite
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.