Hello, I would like to create a specific database for users, however I do not know how to set up two databases on the system, I currently changed the database.php file to the following:
[php]<?php if ( ! defined('BASEPATH')) exit('No direct access allowed');
$active_group = 'default';
$query_builder = TRUE;
$db['default']['dsn'] = '';
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'DB1';
$db['default']['password'] = '*****';
$db['default']['database'] = 'DB1';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = 'pr_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = (ENVIRONMENT !== 'production');
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['encrypt'] = FALSE;
$db['default']['compress'] = FALSE;
$db['default']
['stricton'] = FALSE;
$db['default']['failover'] = array();
$db['default']['save_queries'] = (ENVIRONMENT !== 'production');
$db['outra']['dsn'] = '';
$db['outra']['hostname'] = 'localhost';
$db['outra']['username'] = 'DB2';
$db['outra']['password'] = '****';
$db['outra']['database'] = 'DB2';
$db['outra']['dbdriver'] = 'mysqli';
$db['outra']['dbprefix'] = 'pr_';
$db['outra']['pconnect'] = TRUE;
$db['outra']['db_debug'] = (ENVIRONMENT !== 'production');
$db['outra']['cache_on'] = FALSE;
$db['outra']['cachedir'] = '';
$db['outra']['char_set'] = 'utf8';
$db['outra']['dbcollat'] = 'utf8_general_ci';
$db['outra']['swap_pre'] = '';
$db['outra']['autoinit'] = TRUE;
$db['outra']['encrypt'] = FALSE;
$db['outra']['compress'] = FALSE;
$db['outra']['stricton'] = FALSE;
$db['outra']['failover'] = array();
$db['outra']['save_queries'] = (ENVIRONMENT !== 'production');
/* End of file database.php */
/* Location: ./system/tastyigniter/config/database.php */
[/php]
And then i tried to change a query line from;
[php]
$this->CI->db[/php]
to
[php]
$outra->CI->db[/php]
Does anyone know how to help me?