viion Posted March 27, 2009 Share Posted March 27, 2009 I'm trying to pull information on a database where a specific value = the current session logged into phpbb. To get the value of the current session its: $user->data['username_clean'] I've tried what is shown below, I've also tried something like: $currentSession = $user->data['username_clean']; then do a where search on $currentSession, but no luck there. If i hardcode a value in such as my forum username, it'll work, just wont translate them variables in the function. This is the code: $display_characters = mysql_query("SELECT ". CHARACTER_CONFIG_PLAYNAME ." FROM ". CHARACTER_DATABASE ." WHERE ". CHARACTER_CONFIG_USERNAME ."='". $user->data['username_clean'] ."'"); Quote Link to comment https://forums.phpfreaks.com/topic/151349-solved-pulling-data-where-username-session-not-working/ Share on other sites More sharing options...
viion Posted March 27, 2009 Author Share Posted March 27, 2009 I figured this out btw, if anyone wants to know. To allow a variable outside a function to be called within function i had to set a global on the variable. Quote Link to comment https://forums.phpfreaks.com/topic/151349-solved-pulling-data-where-username-session-not-working/#findComment-795225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.