Welcome Guest, Not a member yet? Register   Sign In
Turn off "You have specified an invalid database connection group."
#1

[eluser]huzzel[/eluser]
How could i do that ?

thanks :-)
#2

[eluser]summery[/eluser]
The best way might be to specify a valid database connection group. Wink

Read about establishing database connections in CI.

Two basic things to check for in your config/database file:
- is $active_group variable set to a valid array of config variables? Default, perhaps?
- are your database config variables correct - hostname, db name, etc?

Good luck!
#3

[eluser]mikelbring[/eluser]
Or don't autoload the database?
#4

[eluser]huzzel[/eluser]
Thanks for your replies,

i tried to connect to different databases in a controller

so i created a object for each database like this

$this->active_db_1
$this->active_db_2
$this->active_db_3

If one of the database server goes offline the script dies...

Maybe i have to check first db_connect() before i load each active_db

well the problem is here

Code:
function &DB;($params = '', $active_record_override = FALSE)
{
    // Load the DB config file if a DSN string wasn't passed
    if (is_string($params) AND strpos($params, '://') === FALSE)
    {
        include(APPPATH.'config/database'.EXT);
        
        if ( ! isset($db) OR count($db) == 0)
        {
            show_error('No database connection settings were found in the database config file.');
        }
        
        if ($params != '')
        {
            $active_group = $params;
        }
        
        if ( ! isset($active_group) OR ! isset($db[$active_group]))
        {
            show_error('You have specified an invalid database connection group.');
        }
        
        $params = $db[$active_group];
    }

So i hav to patch the controller DB.

I created a helper to solute this

thanks




Theme © iAndrew 2016 - Forum software by © MyBB