Jump to content

Pulling data from two tables, compare, and output?


NewcastleFan

Recommended Posts

Hey Guys,

 

I'm struggling with some logic of how to do something wondering if anyone can point me in the right direction.

 

Details:

I am making a PHP/MySQL game to learn more PHP, I've got my login/logout system created. However I am planning on the game been map based on a 100x100 grid. I have two tables:

 

USERS

Username, Password, x, y

Test, Test, 1, 1

 

 

MAP

X, Y, type

0,1,1

0,2,1

0,3,2

0,4,3

0,5,2

etc

 

I am stuck on how to get the user's logged in X and Y coordinates and then compare them with the map table X and Y, to see what type of field to show, 1,2 or 3.

 

Is there a name for this type of function so I can do some research on it? Or could someone give me an example? Would be fantastic if anyone has any advice.

 

Thanks in advance

NewcastleFan

Link to comment
Share on other sites

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.