Quote:
|
Originally Posted by icb01co2
My question specifically is about the Pear::DB libary. Quite simply, why should I use it? What advantages does it have over me using the standard db connection functions the php lib has?
|
The first question you should ask yourself is do you need to use it?
The idea behind Pear::DB or any database abstraction layer is to place all database specific code in a single class wrapped by your own functions. If you use MySQl as you db of choice then you can use a MySQL abstraction layer/class, need to use Postgre at some point in the future then you just swap the layer/class for one that deals with Postgre, no code editing needed as all your code makes calls to your db functions rather than database specific functions.
I don't use any of the pear libraries myself, most php programmers will find them bloated and overkill for most situations and usually end up developing their own php framework that handles db abstraction, templating, mailing, sessions, input sanitization and more depending on the level of application they are developing.
Pear wil get the job done but if I were in your shoes I would be looking to develop a small framework that you understand totally rather than learning to interact with pear libraries.
Checkout phpclasses.org you will find most of what you will need in there.