77949

Where can I find a list of PEAR DB error codes?

Question:

I'm trying to establish a connection to a mysql database using PEAR DB. It's throwing the following error at me:

<blockquote>

DB_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => -4 [message] => DB Error: not found [userinfo] => Unable to include the DB/dbxxxxx:xxxxx@internal-db.sxxxxx.gridserver.com/dbxxxxx_toomodern.php file for 'dbxxxxx:xxxxx@internal-db.sxxxxx.gridserver.com/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:xxxxx@internal-db.sxxxxx.gridserver.com/dbxxxxx_toomodern.php file for 'dbxxxxx:xxxxx@internal-db.sxxxxx.gridserver.com/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 <em>RECURSION</em> [type] => -> [args] => Array ( [0] => -4 [1] => 1 [2] => 1024 [3] => Unable to include the DB/dbxxxxx:xxxxx@internal-db.sxxxxx.gridserver.com/dbxxxxx_toomodern.php file for 'dbxxxxx:xxxxx@internal-db.sxxxxx.gridserver.com/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:xxxxx@internal-db.sxxxxx.gridserver.com/dbxxxxx_toomodern.php file for 'dbxxxxx:xxxxx@internal-db.sxxxxx.gridserver.com/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:xxxxx@internal-db.sxxxxx.gridserver.com/dbxxxxx_toomodern ) ) ) [callback] => ) 1

</blockquote>

my code is as follows:

<?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:$db_pass@$db_host/$db_name"; $resource = $db->connect($dsn); }

Can anyone see my error here? Is there an index of PEAR errors online, I can't for the life of me find them!

Answer1:

You also have to inlcude the DB type, so if it's MySQL, you would need to change it to

$dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";

Recommend

  • Locate file, and copy its path. Batch script
  • PECL OAuth for PHP 5.3 on CentOS 5
  • Qt application crashes on exit, OS applies “fault tolerant heap shim”
  • How to encode 2 dimentional PHP array to Javascript Array?
  • Launching xdebug in Eclipse stuck at 57% - How to trouble-shoot? [duplicate]
  • not able to auto import react components from node modules
  • UINT_MAX the same as ULONG_MAX in C
  • Replace values from list into numbers then perform arithmetic calculation
  • Order of evaluation in C++ function parameters
  • Drools Java 7 support in Eclipse
  • PHP GnuPG segfaults in a webserver
  • c++ reinterpret_cast, virtual, and templates ok?
  • Has MvxCachingFragmentCompatActivity disappeared?
  • Powershell: Doubled double quotes in inline expressions
  • Eloquent pre-loading relationships against DB write connection
  • Distcp Mismatch in length of source
  • Getting undefined symbol: __asan_memset when trying to use Clang address sanitizer
  • how to send the response to browser fromm http.request in node.js?
  • Powershell Transcript is empty when running script from SQL Agent Job in 2005 SQL Server
  • Sorting elements of vector where each element is a pair [duplicate]
  • FQL returning empty set?
  • Argument of '#selector' does not refer to an '@objc' method (swift 3)
  • How to create virtual printer with iOS Simulator?
  • removing last 3 characters on a file (file extension)
  • aapt.exe'' finished with non-zero exit value 1
  • Android app gives error “BatteryStatsImpl: reading network stats”
  • Unable to install Git-core+svn by MacPorts
  • Unable to decode certificate at client new X509Certificate2()
  • How can I extract results of aggregate queries in slick?
  • Needing to do .toArray() to get output of mongodb .find() on key name not value
  • How to run “Deployd” on port 80 instead of port 5000 in webserver.
  • The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid ver
  • MongoDB in PHP using aggregate to group by _id is null not working
  • SignalR .NET Client Invoke throws an exception
  • Launch Runnable Jar from Web Start
  • Why is the timeout on a windows udp receive socket always 500ms longer than set by SO_RCVTIMEO?
  • Buffer size for converting unsigned long to string
  • Hits per day in Google Big Query
  • Turn off referential integrity in Derby? is it possible?
  • How to get Windows thread pool to call class member function?