Counties in codeigniter with DB data

Asked

Viewed 107 times

-2

Good afternoon I need to get some settings for my site that comes from a table in the database, currently I use variable more then every time have to go there at the bank to get, I think this can slow my application can not?

True case what would be the most appropriate form?

In search on google parent I saw that constants can store data for as long as the application stay running, it would be a good practice I use constants to leave saved data.

The data I need to leave recorded are, I have a price of my products, in them I have to assign a discount for cash payment, but I want to leave the option for my client to change that discount rate in his admin, so he doesn’t ask me after a while to keep changing or will know have customers want to change every month.

In a search in the config folder has a file constants.php, that if I create there it is already for the whole site more there I could not load a model I think it should not be possible to do this. But I don’t know if it will be right to use constants, I need help from you. Thank you very much.

1 answer

3


Do not use constants for dynamic values.

These discount rules should be set within a database table, just as you are doing now. Eventually even a screen for the user to set the discount values.

The information is small and will not impair the performance of your application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.