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.

TABLE OF CONTENTS:
  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
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
   

MYSQL ARTICLES

- Xeround Releases Free Version of MySQL Cloud...
- Oracle Announces New MySQL Specialization
- Constant Contact Chooses SkySQL for MySQL Su...
- Revoke Statement in MySQL
- The Grant Statement in MySQL
- SuccessBricks Announces ClearDB Availability...
- Building a PHP ORM: Deploying a Blog
- TROSYS Launches Free MySQL Manager and Admin...
- Building an ORM in PHP: Domain Modeling
- Building an ORM in PHP
- MySQL Leads Open Source Market, Gets Cluster...
- Oracle Announces Milestone Release for MySQL
- How to Stop SQL Injection Attacks
- New Defragmentation Solution for SQL Server
- Comparison of MyISAM and InnoDB MySQL Databa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap

Dev Shed Tutorial Topics: