funkgut Posted August 26, 2006 Share Posted August 26, 2006 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, Quote Link to comment Share on other sites More sharing options...
funkgut Posted August 26, 2006 Author Share Posted August 26, 2006 when I go to this page nothing shows up I get no errors, just a blank page[code]<?phprequire '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 queryif(DB::isError($create)) { die($create->getMessage());} else { echo 'Table created successfully.';}$db_object->disconnect();?>[/code] Quote Link to comment Share on other sites More sharing options...
funkgut Posted August 26, 2006 Author Share Posted August 26, 2006 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 containthe 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.