• I’m trying to install wordpress in a site that’s already being used and I can’t edit any of the current code. For the most part, the main site and the blog are totally separate, but the header and footer come from the main site. Everything is working ok, except when the main site is trying to access the database (it needs to grab some dynamic content from the database). The issue appears to be that wordpress is somehow “un-setting” the global variables. Below is an example of code that’s causing problems.

    function getCurrentUserName() {
    	global $db_host,$db_user, $db_passwd, $db_database, $tmp_user_name;
    ...
    }

    unfortunately when I echo out $db_user (or any of the global variables) they don’t have any values (where normally outside the blog they definitely do).

    Anyone have any idea what’s going on?

    thanks!

  • The topic ‘global variables’ is closed to new replies.