Possible Duplicate:
Reading and Writing Configuration Files
Most of my functions depends on settings.
As of now I'm storing my setting values in database.
For example to display ad in a page i'm checking my database whether to display ad or not
I mean like this
$display_ad = 'get value from database';
if ($display_ad) {
echo 'Ad code goes here';
}
This is fine. But the fact is I have more than 100 settings. So I think my databse load will be reduced if I define the value in a settings.php file like
define('DISPLAY_AD', true);
if (DISPLAY_AD) {
echo 'Ad code goes here';
}
But I'm not sure this is the right way. Is define()
is the correct solution. Or is there any better and faster solution available?