Welcome Guest, Not a member yet? Register   Sign In
Custom Database Configuration File in Controller
#1

[eluser]Unknown[/eluser]
I have got error "Your application/config/database.php file does not appear to contain a valid configuration array." when load config database in codeigniter:

Here my controller:
Code:
$this->config->load('database');

And another question:
I load config file database and I want to change config database from controller? will know how to do that?
Thanks!
#2

[eluser]Otemu[/eluser]
Hi,

Nothing wrong with

Code:
$this->config->load('database');

most likely you have an error in the actual database config file, if you paste the code for that config we can take a look.

To dynamically change an item try what is listed in the guide

Quote:Setting a Config Item

If you would like to dynamically set a config item or change an existing one, you can do so using:
$this->config->set_item('item_name', 'item_value');

Where item_name is the $config array index you want to change, and item_value is its value.




Theme © iAndrew 2016 - Forum software by © MyBB