Log in

View Full Version : Query-ing multiple tables.



Christiaan
07-20-2011, 10:38 PM
Hello everyone.

I have a database, which contains two tables:
Members:
ID; Firstname; Lastname; Log-in; Password; Base.
Mining:
ID; Type; Level; Coordinates.

Now would I like to get a query that does the following:
A: Look what player is accessing the page to determine his base coords (the player is logg-ed in to the site, so he has a valid session going);
B: Extract the required data (the player can set the criteria trough a form!)
C: Post the extracted data onto the site.

The site it's about:
http://swr.infiniteserve.com/swr2/mi...ost_mining.php

Could someone please advise?
Thanks!

Christiaan

traq
07-20-2011, 10:40 PM
your link is broken.
what do you mean by "post the data"? do you mean display it, or is there actually another page/site that you need to post to?

Christiaan
07-20-2011, 11:22 PM
Somehow the link gets altered when it's posted...
Please look here:

http://swr.infiniteserve.com
/swr2/mining/post_mining.php

Sorry about that Adrian.

What I'm after is this:
The player can select search criteria in the right-hand form on that site. The query then should:
A. Look up the user's base coordinates (which are stored in the table 'members');
B. Find the right type (oil/ metal/ energy or zynthium) mine (which are stored in the table 'mining'.
C. Use the players criteria to display the type of mines/ level/ within that distance of his base.

Does that make more sense to you? The result IS displayed on the same page.

Thanks for advising/ helping.
Christiaan

traq
07-21-2011, 03:42 AM
post links like this:
[ url=http: //swr.infiniteserve.com/swr2/mining/post_mining.php ]my link[ /url ]
if you simply use
[ url ] http: //swr.infiniteserve.com/swr2/mining/post_mining.php [ /url ]
the text between the tags will get truncated, AFAIK the value inside the tag will not.

However, I don't get a response from the link you posted. I can get the main page ( infiniteserve.com ), but not any page from swr.infiniteserver.com, and infiniteserve.com/swr2/mining/post_mining.php just sends me back to the main page.

--------------------------------------

As for your questions,


It sounds like your database already exists. if so, please post the structure of the relevant tables, and give an example of how the data is saved.
how do we "find" the right types of mines? how do we determine which mines are "closest"? do you already have this logic worked out in your script?
how do you want to display your results?