PEAR (PHP Extension and Application Repository)
is a large collection of PHP modules available for various purposes.
PEAR modules can be used to handle database tasks, create HTML
tables and forms, parse email and more. The PEAR authors have
created something similar to CPAN for PHP. CPAN (Comprehensive Perl
Archive Network) is a unique repository of Perl.
PEAR is still in its infancy, but already contains
a myriad of modules that make programming faster and easier. One
module is the PEAR DB module, written in a form comparable to its
older Perl DBI cousin. Many conventions are strikingly similar,
especially through using the ‘?’ character for placeholders.
PEAR DB is simpler and smaller than the OCI8
module, consequently it lacks support for dynamic cursors. If
application plans include dynamic cursors (REF cursors in Oracle
jargon), PEAR DB is not an option. On the other hand, PEAR DB does not
require any special considerations for LOB variables and columns. It
treats them just like any other variable type.
This chapter describes how to use PEAR DB and
gives brief examples of how to use other PEAR modules, such as the
module for creating HTML forms and converting a result set to an HTML
table. This chapter is organized as follows: