PHP question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Vaughn Treude
Date:  
To: plug-discuss
Subject: PHP question
Hello all:
I'm a definite newbie to PHP. What I'm trying to do is to create a user
database on my organization's web site. It's hosted by hostcentric.com. The
first thing I did was to request that hostcentric create a mySQL database for
me. Then I uploaded a sample PHP file from a login tutorial and tried to
execute it. This is the PHP file:

<?php

//require the PEAR::DB classes.

require_once 'DB.php';


$db_engine = 'mysql';
$db_user = 'XXXX';
$db_pass = 'YYYYYYYY';
$db_host = 'ieeepacn.com';
$db_name = 'ZZZZZZZ';

$datasource = $db_engine.'://'.
              $db_user.':'.
              $db_pass.'@'.
               $db_host.'/'.
                $db_name;



$db_object = DB::connect($datasource, TRUE);

/* assign database object in $db_object,

if the connection fails $db_object will contain

the error message. */

// If $db_object contains an error:

// error and exit.

if(DB::isError($db_object)) {
    die($db_object->getMessage());
}


$db_object->setFetchMode(DB_FETCHMODE_ASSOC);

// we write this later on, ignore for now.

//include('check_login.php');

?>

And this is the result when I try to run db_connect.php:

Warning: main(DB.php): failed to open stream: No such file or directory in
/data/web/76076/www/test/db_connect.php on line 5

Fatal error: main(): Failed opening required 'DB.php' (include_path='.') in /
data/web/76076/www/test/db_connect.php on line 5

The script uses the PEAR extensions for PHP-to-database connectivity. Since
hostcentric's Unix servers support PHP I was hoping they also had the PEAR
files installed. I called their tech support guy and he didn't know. He did
direct me to a page called 411.php under my site's domain, which shows a
"configure" box that includes an option called "--with-pear". This seems to
indicate that they have PEAR, but where? From the error messages above I
seem to have a bogus include path.

Any suggestions from the PHP gurus out there? Do I need to upload all the
PEAR support files, such as DB.php? Or is there a normal place where these
are located? If so, how do I update the include path?

Thanks!

Vaughn Treude
Nakota Software, Inc.
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss