Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1069045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:21:47+00:00 2026-05-16T20:21:47+00:00

I am creating RPG type game. I pull out player’s information in every page

  • 0

I am creating RPG type game. I pull out player’s information in every page loaded from two tables with JOIN (it is information about member: age, name, his all game’s stats and etc) and sometimes this information is required for me, sometimes not at all. Two tables consists of ~60-70 rows. Here is an example:

$query = mysql_query("SELECT m.*, i.*
                        FROM members AS m
                        INNER JOIN information AS i
                        ON n.m_id = s.m_id AND n.secret_code= '$code' AND n.password = '$password'") 
                        or die(mysql_error());

I run this query every page. And I put this query on header.php file which is included in index.php file. I am doing everything through index.php file with including files, like that:

If it is page index.php?id=gym I include folder gym with all its files.

What would you suggest me? Re-write all system and insert into each file a query which would pull out only necessary information? Use Sessions? But if I buy, for example, two items, how can I know when to get data on how much member has money? Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:21:47+00:00Added an answer on May 16, 2026 at 8:21 pm

    Some information could be stored in the session. Non-volatile things like user name, player/character name, etc… That’s not going to change very often. But things like current score, gold/credits available, etc.. which change frequently and should be kept consistent would most likely have to be pulled from the database each time. Consider what happens if they open two browser windows and do some shopping in each. Both load up saying you’ve got 500 gold available and both could potentially purchase something for 499 gold at the same time.

    But, it comes down to what’s faster, really. Do some benchmarking and see if pulling 60-70 bits of data from the database for each hit is faster/slow than pulling a mix of database/session data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a pacman-like game, where a player eats objects. When a MovieClip (box) eats
While creating a simple client for a REST service which I have stubbed out,
Creating a simple public/private keypair, such as through ssh-keygen does not create a file
Creating a document fragment using plain Javascript is dead simple: var docFragment = document.createDocumentFragment();
Creating a website using simple html(not html5) and css but got stock in mouseover
Am creating a custom attribute for my properties and was wondering if anyone know
When creating XML I'm wondering why the CDATA blocks are uses rather than just
Im creating pdfs server side with lots of graphics so maximizing real estate is
When creating projects in Hudson, I usually have to check a few CVS repositories

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.