If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[MySql] range query

Hi,

I want to make a world map for a game but before i (can) do that i need to learn how to and what the possibilities are. Therefor i am building a test environment. But i'm already kinda stuck on my first query.

I have made this table called "world" with these columns:
systemID -> not really used yet as there is just 1 system/world.
orderID -> dunno if i really need this one as i could probably order my table from the xpos and ypos.
xpos
ypos
tileID -> refers to the primary key of the table where i store my tiles.

I have filled this table with 25 rows to represent a 5x5 grid. where all the outer tiles are 3 (water) the middle tile (3,3) is 2 (desert) and the rest are 1 (grass).

Now my query needs to select all the "tiles" around the players location. Unfortunately my query only returns the current position to me where i expect it should give me 9 values. Here's the code:

in the PHP file and get this div output into my map container inside the html file? Or should i look to somehow get the array data into my HTML file and make the loop there to generate the map asynchronous with javascript/AJAX?