Page 1 of 1

Properly echo a define in database result

Posted: Fri Nov 21, 2008 2:08 pm
by rotaour
Not sure how to get this to work. I run two sites each with defines like;

Code: Select all

define('MY_NAME', 'Jim');
I also have a contest method that queries and displays all current contests. Now I want to run the same contest on both sites and the name should be something like;

Win big with MY_NAME

How do I get a result row to display this correctly?

I've tried entering the name(in the DB) as Win big with ".MY_NAME.", '".MY_NAME."', and <?php echo MY_NAME; ?>, but it prints it out rather than echoing the define, any tips? Can this be echoed properly from printing a result row?

Thanks

Re: Properly echo a define in database result

Posted: Sat Nov 22, 2008 11:27 pm
by novice4eva
check to see if

Code: Select all

defined('MY_NAME')
returns true or false. If it returns false then it means that the constant has not been defined, i am assuming that the defined thing is in separate PHP file, if that's the case then check to see if you have included it in your file properly.