CMNetworx Posted March 12, 2008 Share Posted March 12, 2008 I want to have my menu buttons loaded out of my mysql database, so I can edit them quickly in a login panel.. What I am wondering is, I figure there would be alot of stress on the database if every time someone visits any page it does a query to figure out the menu buttons.. Is there a way to easily retain this information so the query can be done once, and not per page? I suppose this would be a session, but is there any other way? or a more efficient way? or are sessions the best? Thanks for any help.. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted March 12, 2008 Share Posted March 12, 2008 I can't think of anything except sessions. Maybe an array with all the menu options. Quote Link to comment Share on other sites More sharing options...
CMNetworx Posted March 12, 2008 Author Share Posted March 12, 2008 I will probably just throw it into a session.. The answer kinda hit me as I was typing the question, but I still felt compelled to ask.. Another quick question, Is there any way to have multiple sessions running at the same time? like one session that starts to create and retain the set of buttons, then later another session starts as the user logs in to their panel, and it holds their name, etc.. Would the sessions just blend together? or raise hell..? Quote Link to comment Share on other sites More sharing options...
craygo Posted March 12, 2008 Share Posted March 12, 2008 Sessions are just like any other array you can hold the page info in one session array $_SESSION['page'] so upload button can be $_SESSION['page']['upload'] = "link to upload page"; $_SESSION['page']['download'] = "link to download page"; and when the user logs in hold their data in another session array $_SESSION['user']['username'] = "username"; And so on Ray Quote Link to comment Share on other sites More sharing options...
CMNetworx Posted March 12, 2008 Author Share Posted March 12, 2008 Awesome Thanks Quote Link to comment 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.