I might be barking up completely the wrong tree so forgive me if this isn’t at all how I should be doing things.
I’ve a config table in my database which is to hold config details for my website. I want to load this data into the config.php file for code igniter?
Is this something I should be doing or totally wrong?
If I put a database call at the top of the config.php file will this get called every time someone loads the site or just the first time?
Sorry if this sounds totally stupid I’m a bit confused.
Edit
I’m not meaning database details, for example want to store something like the amount of post to be shown per page. The script I’m creating is to be used on more than one server the amount of post per page for example needs to be editable. I could of cause load this into a session but I thought loading it as a constant*? in a config file would be a better idea.
You could create a new model that pulls the config options from the database and then autoload this model so that it’s available globally. Then, you could access your options via
$this->model_name->function_name($db_column);and have$db_columnbe the name of the column for the option you’re looking for and have your model function select and return the column data.Personally, I use a custom config file:
http://codeigniter.com/user_guide/libraries/config.html