Welcome Guest, Not a member yet? Register   Sign In
want to use multiple database.
#2

[eluser]louisl[/eluser]
Check in the index.php for the ENVIRONMENT constant, I think that was added in 2.0.1
Then just switch your ./application/config/database.php depending on the environment eg.
Code:
switch (ENVIRONMENT) {

case 'development' :

  $db['default']['username'] = 'xxx';
  $db['default']['password'] = 'xxx';
  $db['default']['database'] = 'xxx';
  
break;

case 'testing' :
case 'production' :

  $db['default']['username'] = 'yyy';
  $db['default']['password'] = 'yyy';
  $db['default']['database'] = 'yyy';
  
break;

default:

  exit('The application environment is not set correctly.');
  
break;

}


Messages In This Thread
want to use multiple database. - by El Forum - 02-20-2012, 11:15 PM
want to use multiple database. - by El Forum - 02-21-2012, 07:19 AM
want to use multiple database. - by El Forum - 02-21-2012, 10:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB