tags:

views:

212

answers:

3

Hey Guys,

I am a noob to PHP can anyone explain me whats Pear DB library with a practical use?

Thanks

+1  A: 

Its just a database abstraction library. ALlows you to connect to different kinds of databases (MySQL, PostgreSQL) using a consistent API.

Darrell Brogdon
+1  A: 

http://pear.php.net - PEAR is a framework and distribution system for reusable PHP components.

EDIT(to the first answer):

Except DB abstraction packeges PEAR library contains huge amount of useful classes for work with XML, CURL etc. Full list of maintained packeges is available here.

BTW, PEAR stands for PHP Extension and Application Repository

Alex
A: 

The What: Pear DB is abstraction layer. Its one of many framework components available from PEAR. What the heck is that? Its a layer/interface between PHP and the db provider (MySQL, MSSQL,Protege) . So, it handles calls to multiple types of db providers in pretty much the same way to your PHP application. Your application layer doesn't have to concern itself with the details of calling individual providers.

Pros: Portability. Allows you to write your db interface code once and have it work with multiple providers. Encapsulation. Makes many db calls a bit simpler to make.

Cons: Performance. It will generally be a bit slower than calling php db commands directly.

Nutshell: Its good to use it when you can.

weezy