Jump to content

PEAR DB.php location


funkgut

Recommended Posts

Hello all,

I am a pear newbie.  I am having my site hosted on a virtual server with plesk and my host host says they have PEAR support.

My problem is where to find DB.php that is included in all the files.  This has all the db variables so none of pages work. Is there a place that PEAR is usually nstalled on a host or what?

Thanks,
Link to comment
Share on other sites

when I go to this page nothing shows up I get no errors, just a blank page

[code]<?php

require 'db_connect.php';

// require above script
// change the path to match wherever you put it.


$table = "CREATE TABLE users (
id int(10) DEFAULT '0' NOT NULL auto_increment,
username varchar(40),
password varchar(50),
fullname varchar(65),
address varchar(150),
city varchar(50),
state varchar(4),
zip varchar(15),
email varchar(100),
chiefemail(100)
location varchar(150),
show_email int(2) DEFAULT '0',
last_login varchar(20),
PRIMARY KEY(id))";

$create = $db_object->query($table); //perform query

if(DB::isError($create)) {
die($create->getMessage());
} else {
echo 'Table created successfully.';

}

$db_object->disconnect();

?>[/code]
Link to comment
Share on other sites

here is db_connect.php


[code]<?php

//require the PEAR::DB classes.

require_once '/usr/bin/pear/DB.php';


$db_engine = 'mysql';
$db_user = 'ply_mess';
$db_pass = 'bill1022';
$db_host = 'localhost';
$db_name = 'plymovent';

$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');


?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.