Jump to content

Recommended Posts

I was wondering what would be better for computer resources and speed wise if lets say I got about anywhere from 3,000 - 6,000 people on my site at once if I:

 

Loaded information from mysql once and then loaded the needed variables into the the SESSION variable (Things like if you want to receive emails, your signature in a forum)

 

-- OR --

 

Loaded the information from mysql as often as possible and keep the minimal amount of variables inside SESSION (Things like UserID, AuthID)

 

 

Thanks alot in advance!

  - tsilenzio

Link to comment
https://forums.phpfreaks.com/topic/62269-sessions-vs-mysql-database/
Share on other sites

I try to store a lot in sessions. Like information that is used allot throughout the page.

 

Keep in mind that every query you have is slowing down the execution rate. But if you already have a set value as a session for user name email and information you use alot, than you won't need to slower the execution rate with mysql queries.

the other thing to  keep in mind, is if your storing things in your session, that really need to be in the database.  I have had this problem with my game, where i place like Points in teh session, but forget to update teh DB, so i end up having everything working for that on euser, btu the other users arent experienceing anything.  Keep that in mind as well :)

Okay but what if you store something in the game that you plan to put in the database like lets say the users money if its a php game, they buy / sell 50 things each so their money is completly diffrent, but they leave the game up, or theyexit the browser before they go to a page that updates their info into the database? =/

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.