Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4329642
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:51:05+00:00 2026-05-21T09:51:05+00:00

I might be barking up completely the wrong tree so forgive me if this

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:51:06+00:00Added an answer on May 21, 2026 at 9:51 am

    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_column be 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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a 3rd-party rotator object, which is providing a smooth, random rotation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.