Welcome Guest, Not a member yet? Register   Sign In
Dynamic database.php configuration
#1
Question 
(This post was last modified: 05-31-2017, 11:48 AM by zashishz.)

Hi,

Is it possible to get data from a form and pass the values to application/config/database.php to configure database dynamically.
Can we read and update below values programatically..??

Code:
$db['default'] = array(
    'dsn'    => '',
    'hostname' => 'localhost',
    'username' => '',
    'password' => '',
    'database' => '',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);


Thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB