PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, August 31, 2022

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

 August 31, 2022     database, mysql, pear, php     No comments   

Issue

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

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 RECURSION [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

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!


Solution

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"; 


Answered By - fin1te
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing