DB

#1
[eluser]mom_maj[/eluser]
hi , i try to load two DB but he give error (You have specified an invalid database connection group) i check the database configuration and make it as a variable ($DB1=$this->load->database('DB1', TRUE)), whats the problem.

#2
[eluser]Seppo[/eluser]
The problem seems to be that you have not set the config settings for DB1 group in config/database.php

#3
[eluser]Frank Rocco[/eluser]
Here is what I have.

In database.php
$db['default']['hostname'] = "xx.xx.xx.xx";
...
$db['as400']['hostname'] = "xx.xx.xx.xx";
...

in controller
$DB2 = $this->load->database('as400', TRUE);

Frank

#4
[eluser]mom_maj[/eluser]
that in confige


$active_group = "DB1";

$db['DB1']['hostname'] = "localhost";
$db['DB1']['username'] = "root";
$db['DB1']['password'] = "";
$db['DB1']['database'] = "DB1";
$db['DB1']['dbdriver'] = "mysql";
$db['DB1']['dbprefix'] = "";
$db['DB1']['active_r'] = TRUE;
$db['DB1']['pconnect'] = TRUE;
$db['DB1']['db_debug'] = TRUE;
$db['DB1']['cache_on'] = false;
$db['DB1']['cachedir'] = "/var/www/codeigniter/system/application/caching";


$active_group = "DB2";

$db['DB2']['hostname'] = "localhost";
$db['DB2']['username'] = "root";
$db['DB2']['password'] = "";
$db['DB2']['database'] = "DB2";
$db['DB2']['dbdriver'] = "mysql";
$db['DB2']['dbprefix'] = "";
$db['DB2']['active_r'] = TRUE;
$db['DB2']['pconnect'] = TRUE;
$db['DB2']['db_debug'] = TRUE;
$db['DB2']['cache_on'] = false;
$db['DB2']['cachedir'] ="/var/www/codeigniter/system/application/caching";



and in controller is


$DB1=$this->load->database('DB1', TRUE);
$DB2=$this->load->database('DB2', TRUE);


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.