PEAR DB Problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mahmudhasankajal
Forum Newbie
Posts: 1
Joined: Mon May 19, 2003 7:28 pm

PEAR DB Problem

Post by mahmudhasankajal »

Hi, I was trying to use PEAR DB class to connect to a mySQL database. From one script I could connect and get result but I couldn't do from another script though nothing is different. Second script was reached by redirection (header("Location...)) but I believe that shouldn't create any problem. here is the code in the second script (part of it)

require_once('DB.php');
include("dbinfo.php");
.........
.........
$dsn = $dbengine.'://'.$dbuser.':'.$dbpass.'@'.$dbhost.'/'.$dbname;
$db = DB::connect($dsn,TRUE);

I checked the php.ini file and I have pear in the include_path (if it wasn't the other script wouldn't be able to connect to the database). Any help would be very much appreciated.

if anyone wants I can send the code by email.
Mahmud
Post Reply