Contributors in codeigniter with DB data

-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 all the time have to be going there in the bank to pick up, I think this may leave my application slow can not ?

If true, what would be the most appropriate way?

In search of the parent google saw that the constants can save data by the time the application is running, it would be a good practice to use the constants to save the data.

The data that I need to save is, I have a price of my products, I have to assign a discount to the cash payment, but I want to leave the option for my client to change this discount rate in his admin, so he does not be asking me after a while to keep changing or will know has customers want to change every month.

In a search in the config folder has a file constants.php, that if I create there it already gets to the whole site more there I could not do load of a model I think it should not be possible to do this. I also do not know if it will be correct to use constants, I need your help. thank you very much.

    
asked by anonymous 09.07.2015 / 22:34

1 answer

3

Do not use constants for dynamic values.

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

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

    
09.07.2015 / 23:19