Home arrow MySQL arrow PHP, MySQL and the PEAR Database

PHP, MySQL and the PEAR Database

In this conclusion to a three-part series, you will add PEAR into the mix of what you have already learned. This article is excerpted from chapter 9 of Learning PHP and MySQL, written by Michele Davis and Jon Phillips (O'Reilly, 2006; ISBN: 0596101104). Copyright 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

  1. PHP, MySQL and the PEAR Database
  2. Rewriting the Books Example with PEAR
  3. Creating a connect instance
  4. PEAR error reporting
By: O'Reilly Media
Rating: starstarstarstarstar / 8
May 31, 2007

print this article



Hosted ISP

Most ISPs have PEAR DB installed. Ask your ISP to install it if they haven't already. You can tell if PEAR DB has been installed by trying the PHP code in Example 9-7 to see whether the require_once ('DB.php'); line causes an error when the script is executed.

Adding Additional Packages

Once that's complete, you can access the PEAR Package Manger by entering pear at the command prompt. Adding new modules is as easy as executing pear packagename . You won't need to do anything, since the DB package was installed along with the install by default.

However, if you're running Windows XP Home, you'll need to take these steps to install the PEAR DB:

  C:\>cd c:\php
  C:\>pear install DB
  C:\>pear list

To find out what versions of PEAR packages are installed, execute pear list. That returns a listing such as the one shown in Figure 9-6. 

Figure 9-6.  A listing of installed PEAR packages and versions

Once you've got PEAR installed, you're ready to try it out.

>>> More MySQL Articles          >>> More By O'Reilly Media

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates


Dev Shed Tutorial Topics: