I want to use pear DB package to replace mysql database interface.I installed PEAR, and write the following php code to access mysql database.
require_once "DB.php";
$dsn = "mysql://".$g_dbuid.":".$g_dbpwd."@".$g_host."/".$g_databasename;
$db = DB::connect($dsn);
if (DB::isError($db)) {
die ($db->getMessage());
}
echo "connect database successfully!";
$db->disconnect();
But I get error info as following:
Warning: main(DB.php): failed to open stream: No such file or directory in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2
Warning: main(): Failed opening 'DB.php' for inclusion (include_path='.;d:\php\PEAR') in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2
I want to know why it could not open 'DB.php', I am sure that I have add the path "d:\php\PEAR" in 'php.ini'.
My php edition is 4.3.3, who can help me? Thanks a lot!