Hi All,
I am having problems with the define() statement, in some cases it seems not to have any effect on the Constant I am trying to declare and the Constant keeps the value that was given to it in previous Functions.
If in a previous Function I declared:
define('DB_TABLE', 'old_table');
then running another Function in which I declare:
define('DB_TABLE', 'new_table');
echo DB_TABLE; // displays 'old_table' Previously defined in another Function not taking the new value...
Does anybody has any clues why this is happening ?
Thanks !
El Vasco
define() - having problems to set CONSTANT value
Moderator: General Moderators
Re: define() - having problems to set CONSTANT value
The scope of a defined constant is global and cannot be redefined. You can't define the same variable in different functions. Whichever function is called first defines the constant. That's the difference between a variable and a constant.
Re: define() - having problems to set CONSTANT value
Might be better to use a config array or an ini file
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: define() - having problems to set CONSTANT value
Thank You, Both ! That answers my question and solves my problem 
Tx !
El Vasco
Tx !
El Vasco