Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialkarthikkn
5,397 PointsHow to store php session in a database
I was trying to build an eCommerce website, Where it store a customers wish list of their items in their accounts, so that they can buy after few days. it must have to store the wish list even if they close the browser. Can some one help me. Thanks in advance
5 Answers
Joseph Perez
25,122 PointsSo you probably wouldn't want to store the information into a session since the session ends when the browser is closed. You'd have to make a table in your database to hold all of the wish list data which would then reference a users table of some kind. As far as I know that's the only way I can think of doing it :)
Also this link might help also since you were asking about storing session data into a database. Best of luck! :D http://shiflett.org/articles/storing-sessions-in-a-database
karthikkn
5,397 PointsThanks Joseph. You saved my day man. Thanks again for helping me
karthikkn
5,397 PointsHello, Joseph Could you provide any video for storing an session in database
Joseph Perez
25,122 PointsI wasn't able to find any video on the subject :/ but I was able to find this http://culttt.com/2013/02/04/how-to-save-php-sessions-to-a-database/ it's a good read on sessions and gives a little more detail on how you would accomplish storing session data into a database. Hope that helps a little more!
karthikkn
5,397 Pointsthanks man, for your help Thanks once again