Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: MySQL database connection
08-27-2013, 05:08 PM #1
- Join Date
- Aug 2005
- Thanked 0 Times in 0 Posts
MySQL database connection
Hello and pre-thanks for anyone's interest.
The site I have been tasked to fix is a MySQL, Smarty, PHP site. I have a connection problem. When you call the site up, www.mysite.com You get printed on the browser output,
DB Error: connect failed
<?php require_once("includes/ru_config.php"); require_once("includes/ru_connection.php"); require_once("includes/ru_data.php"); require_once("includes/ru_utils.php"); require_once("libs/ru_smarty.php"); RU_CheckInject(); (other coding ?>
My configuration file is placed at includes/ru_config.php and reads:
define('SMARTY_DIR', '/home/xxxxxx/public_html/libs/smarty/'); define('CONFIG_DIR', '/home/xxxxxx/public_html/configs/'); define('TEMPLATES_DIR', '/home/xxxxxxx/public_html/templates/'); define('COMPILE_DIR', '/home/xxxxxxx/public_html/templates_c/'); define('CACHE_DIR', '/home/xxxxxxx/public_html/cache/'); define('TBL_PROFILE', 'Profile_delivery') define('TBL_SUBDOMAIN', 'subdomain_delivery'); define('USERS_TABLE', "users");
My ru_connection.php file is located at includes/ru_connection.php and reads:
require_once(dirname(__FILE__) . '/ru_4pear.php');
$dsn = 'mysql://' . BASE_USER . ': ' . BASE_PASS . '@' . BASE_SERVER . '/' . BASE_NAME;
//$db = DB::connect($dsn, true);
$db = DB::connect($dsn);
ini_set("include_path", ini_get("include_path") . ":/home/xxxxxx/public_html/libs/pear/");
The reason we have DB.php is that previous to its installation, we could not transfer site coding from one site to the other. I don't believe it is the cause of the error, but if you need to see it, or the entirety of any of the other files, let me know.