jonniejoejonson Posted October 24, 2008 Share Posted October 24, 2008 I understand when you CAN use a session, but when would you better to session than to query... for example - on facebook, if you view my profile page and view my images page, both pages have my name in the heading... Do they query the database to get my name every time, or do they simply session my name?.. and then if the user changes they destroy the name session and create a new one? thanks to any responders. Quote Link to comment https://forums.phpfreaks.com/topic/129949-to-session-or-to-query/ Share on other sites More sharing options...
r-it Posted October 24, 2008 Share Posted October 24, 2008 use sessions, trust me i'm a doctor ( ) Quote Link to comment https://forums.phpfreaks.com/topic/129949-to-session-or-to-query/#findComment-673677 Share on other sites More sharing options...
Garethp Posted October 24, 2008 Share Posted October 24, 2008 It's better to use Query when you are dealing with a value that can change often, that way you don't have to destroy the session every time someone changes the value. Likewise, it's best that you use sessions for something that rarely changes, to reduce server load... Quote Link to comment https://forums.phpfreaks.com/topic/129949-to-session-or-to-query/#findComment-673718 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.