2011-05-16 84 views
0

我想用PEAR DB建立一個到mysql數據庫的連接。它拋出下面的錯誤我:哪裏可以找到PEAR DB錯誤代碼列表?

DB_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => -4 [message] => DB Error: not found [userinfo] => Unable to include the DB/dbxxxxx:[email protected]/dbxxxxx_toomodern.php file for 'dbxxxxx:[email protected]/dbxxxxx_toomodern' [backtrace] => Array ([0] => Array ( [file] => /usr/local/php-5.2.14-2/share/pear/DB.php [line] => 966 [function] => PEAR_Error [class] => PEAR_Error [type] => -> [args] => Array ([0] => DB Error: not found [1] => -4 [2] => 1 [3] => 1024 [4] => Unable to include the DB/dbxxxxx:[email protected]/dbxxxxx_toomodern.php file for 'dbxxxxx:[email protected]/dbxxxxx_toomodern' )) [1] => Array ([file] => /usr/local/php-5.2.14-2/share/pear/PEAR.php [line] => 531 [function] => DB_Error [class] => DB_Error [object] => DB_Error Object RECURSION [type] => -> [args] => Array ([0] => -4 [1] => 1 [2] => 1024 [3] => Unable to include the DB/dbxxxxx:[email protected]/dbxxxxx_toomodern.php file for 'dbxxxxx:[email protected]/dbxxxxx_toomodern' )) [2] => Array ([file] => /usr/local/php-5.2.14-2/share/pear/DB.php [line] => 543 [function] => raiseError [class] => PEAR [object] => DB Object () [type] => -> [args] => Array ([0] => [1] => -4 [2] => [3] => [4] => Unable to include the DB/dbxxxxx:[email protected]/dbxxxxx_toomodern.php file for 'dbxxxxx:[email protected]/dbxxxxx_toomodern' [5] => DB_Error [6] => 1)) [3] => Array ([file] => /nfs/c07/h04/mnt/xxxxx/domains/wedding.juicywatermelon.com/html/validate.php [line] => 9 [function] => connect [class] => DB [object] => DB Object ( ) [type] => -> [args] => Array ([0] => dbxxxxx:[email protected]/dbxxxxx_toomodern ))) [callback] =>) 1

我的代碼如下:

<?php 
    require_once('DB.php'); 
    $db = new DB; 
    $db_host = 'internal-db.sxxxxx.gridserver.com'; 
    $db_user = 'xxxxx'; 
    $db_pass = 'xxxxx'; 
    $db_name = 'xxxxx'; 
    $dsn = "$db_user:[email protected]$db_host/$db_name"; 
    $resource = $db->connect($dsn); 
} 

任何人都可以看到我的錯誤嗎? 是否有在線PEAR錯誤的索引,我不能爲我的生活找到它們!

+0

碼主db.php中記載的錯誤,按照HTTP://梨.php.net/manual/en/package.database.db.db-error.php – 2011-05-16 18:49:01

回答

1

您也可以inlcude數據庫類型,所以如果它的MySQL,你需要將其更改爲

$dsn = "mysql://$db_user:[email protected]$db_host/$db_name"; 
+0

是的,這是我的問題謝謝你.. – starsinmypockets 2011-05-16 18:39:30