/    Sign up×
Community /Pin to ProfileBookmark

Retrieving Data (Assign Variables To Array)

Alright, I’ve been working on this profile system thing for (no lie) almost a year… currently 3 days with barely any sleep.. I have the information collecting and storing part DONE. Now, my issue is with retrieving and displaying the data from the two databases in the user’s profile. There are 2 database tables: test_users and test_profile.

Test_user contains:
id
login
password
display_name
pass_hint
email
tmp_email
active

Test_profile contains:
id
users_id
language
name
age
sex
country
homepage
interests
pic
user_1
user_2
user_3
user_4
user_5
user_6
user_7
last_change

Now, I’m having trouble mainly with the class that handles session creation and login info, I don’t know what all is stored in the session (this isn’t my script and I’m not familiar with classes). [URL=http://users.dreammare.net/access/codehelp.html]This is the link to a textbox that contains the access_user_class and the profile template[/URL]. Oh yeah, I also don’t know how to properly code the array. What I need is to fetch all the data from a row (info belonging to the user who is currently logged in) and assign each piece of data that is retrieved a variable to be called later by the profile. What I do NOT want is to pull the data from the table and then echo or print it out right after the query. This is probably really confusing, and I’m sure the answer is quite easy, but again, 3 days(-sleep)+(3 hours of searching this forum)=- energy. Thanks in advance!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@fozeratorMay 30.2005 — Umm... okay... I'm going to answer this, but I might be wrong with what you're trying to do. Sorry if that's the case...

To find out what's in the session, just find a page after a login, and use the following:

[code=php]
print_r($_SESSION);
[/code]


You'll get a list of everything that's in there...

Wouldn't you just want to store all those values from the table in the $_SESSION array as well... That way you don't need to keep recalling them, but can access them so long as the user remains logged in.

-James
Copy linkTweet thisAlerts:
@SunBlindauthorMay 30.2005 — Hey, Thanks for the help ? Like I said before, this isn't my code and I don't know how to configure objects and stuff. Buuut, with the help you gave me, I just might be able to figure it out now, thanks again!
×

Success!

Help @SunBlind spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...