I am trying to grab multiple rows from a table but they all have slightly different conditions.
Code: Select all
$cordQuery = mysql_query(sprintf("SELECT * FROM WORLD_MAP WHERE ((cordx>=$playerCord[cordx]-2 AND cordx>=$playerCord[cordx]+2) AND (cordy>=$playerCord[cordy]-2 AND cordy>=$playerCord[cordy]+2))"),$cxn);
$displayCord = mysql_fetch_array($cordQuery);
Basically its a 5x5 grid map that I want to display with the original cordx and cordy being the centre grid.
Is there a way to get this information in a 2-dimensional array or some other way to make it easier to work with? For example:
echo(" $displayCord[pos1][active] ");