Forum Moderators: coopster

Message Too Old, No Replies

Reading User Settings / Control Panel

         

Frank_Rizzo

8:33 pm on Mar 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to give users the option of displaying tables in a certain way (colours, sort options, amount of info displayed etc.)

The users will be able to change the settings via a control panel function which will then be stored in a mysql database.

That bit is fine but I don't know which is the best method of retrieving and acting upon that data.

1. User changes the default look and feel of reports in their control panel.
2. User requests a report.
3. User Database is queeried and user settings returned.
4. Report database queeried and a report generated in the users required format.

It is option 3. which I think is a bit of a waste. Every time the user requests a report his settings are called from the user database.

Is it best to load the users settings when he first logs in? Would this be done in cookies or sessions?

There would be around 20 parameters which would be stored. I'm looking for the most efficient way of handling this.

jusdrum

8:37 pm on Mar 8, 2005 (gmt 0)

10+ Year Member



You can store all of your variables in the session, and call them from there. You can also check to see if they are actually in the session before you pull them, and if not, query the database as a last resort, and store them in the session at that point.

bobnew32

8:38 pm on Mar 8, 2005 (gmt 0)

10+ Year Member



You could "do it on the fly", but if its every page that they need to query the database, I would definitely recommend storing the data in php $_SESSION variables when they first login. Good luck!