Forum Moderators: coopster

Message Too Old, No Replies

session variables from mysql, get them all at once?

session variables from mysql, get them all at once?

         

vacorama

6:13 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



hello,
I'm making a new site and am wondering about the best way to query a mysql server.. basically most of the site's pages will display some type of dynamic content based on the user, and im not sure which approach is better.. should i grab all the info i need at login to put into session variables? or should i have queries when/if i need to display the info... im leaning towards getting it all once so the sites main functionality is smoother.. anyone know if im about to make a mistake?

mcibor

8:39 am on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You must remember, that session is a file on the disk, wheather in db a table is a file.
If you need one query to retrieve data stored in db I would reccommend using db for each page.
However if the data is not vast (eg. 10 fields), then you may as well use session.
Summarizing: vast info from db, little data from session

Best regards
Michal Cibor

vacorama

8:47 pm on Jul 28, 2005 (gmt 0)

10+ Year Member



ahh yeah that makes sense. thanks a bunch.