Complicated Setting Session Variables Issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xpiamchris
Forum Newbie
Posts: 10
Joined: Thu Jan 15, 2009 4:17 pm

Complicated Setting Session Variables Issue

Post by xpiamchris »

So here is what I'm trying to do. I'm using someone's code right (jpmaster77 login script).

So when users login, the session variables that are set right now are the uid and the username.

Once users login, they are able to create entries into a database. One of the columns in the database table is their uid, which identifies which entries they are allowed to modify/see. The entries all have a unique ID too (album id).

I need to set it so that the album ID's once they login are set into session variables. However, I'm having a hard time getting the session variables to set because I need to first filter users by their UID but in order to get their UID, I would need for them to login.

How would you guys go about solving this? Any help would REALLY be appreciated.

Best,
Chris
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: Complicated Setting Session Variables Issue

Post by Burrito »

select from the albums table where the UID = $_SESSION["UID"].

loop over the results and save them to an array then set a new session variable for that array.
Post Reply