I'll look into that database, thanks🙂
Using my old MySQL I have already figured out how to select a cube. This is how I was about to do it:
Given newly generated $location_x, $location_y, and $location_z values:
$near_x = range (($location_x - 20), ($location_x + 20));
$near_y = range (($location_y - 20), ($location_y + 20));
$near_z = range (($location_z - 20), ($location_z + 20));
Then I query the database to find values in which they have the near arrays in common. I am not sure which is more efficient, yours or mine, but the major problem is I want a sphere not a cube.