我在尝试访问我们的SCADA网站时遇到此错误:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 341
我扫描到Loader.php文件,然后在341行找到了这段代码:
$CI->db =& DB($params, $active_record);
这是包含错误代码的完整块:
public function database($params = '', $return = FALSE, $active_record = NULL)
{
// Grab the super object
$CI =& get_instance();
// Do we even need to load the database class?
if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db))
{
return FALSE;
}
require_once(BASEPATH.'database/DB.php');
if ($return === TRUE)
{
return DB($params, $active_record);
}
// Initialize the db variable. Needed to prevent
// reference errors with some configurations
$CI->db = '';
// Load the DB class
$CI->db =& DB($params, $active_record);
}
答案 0 :(得分:1)
您提到的文件就是发生问题时调用的位置。
真正的问题是:
application/configuration/database.php
中的设置
或