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
PEAR DB Problem
Moderator: General Moderators