CodeIgniter Forums
Load in Config from database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Load in Config from database (/showthread.php?tid=10336)



Load in Config from database - El Forum - 07-28-2008

[eluser]Yash[/eluser]
I want to load some settings from database into config file.

I've a file blog_settings in config folder.Now I want to load this below code and pass a array to my config file.
any idea how to do that?

Code:
$query = $this->db->get('generalsettings');
$config = $query->result_array();
return $config;

you can't load run db query in blog_settings file.

You need super CI object i guess but I don't want to use that.


Load in Config from database - El Forum - 07-28-2008

[eluser]sophistry[/eluser]
why not just use the config class setter method set_item() ?


check the bottom of this manual page for details