I wonder how I can get acsess to the session variable that contains the username in Drupal. I need this in my own php code to select which database I am going to use.

Comments

voidberg’s picture

Add this: global $user; and use $user->name for the username and $user->uid for the user's id.