Select from DB with sessions?
Posted: Sun Apr 25, 2010 4:48 am
Hi there,
I'm pretty new to PHP. Basically, I'm making an online photo gallery. I'll have users on the site - I have that sorted (i.e. I've worked out how to create user login using sessions etc).
Anyway, once the user has logged in, I want them to be able to save 'favourite pictures' and to be able to view their favourites every time they log in using a mysql database. I can do that. But I'm having problems displaying the favourites from the database. I just can't work out a code / function to do it. So the fields in the database are id, username, password, name, email etc... Can I add a field to store the favourite pics in then recal it once they're logged into their session? I just can't connect the 'username' or any other identifyer with a 'favourites' field in the database.
Help much appreciated!!
Thanks,
Dan
I'm pretty new to PHP. Basically, I'm making an online photo gallery. I'll have users on the site - I have that sorted (i.e. I've worked out how to create user login using sessions etc).
Anyway, once the user has logged in, I want them to be able to save 'favourite pictures' and to be able to view their favourites every time they log in using a mysql database. I can do that. But I'm having problems displaying the favourites from the database. I just can't work out a code / function to do it. So the fields in the database are id, username, password, name, email etc... Can I add a field to store the favourite pics in then recal it once they're logged into their session? I just can't connect the 'username' or any other identifyer with a 'favourites' field in the database.
Help much appreciated!!
Thanks,
Dan