i have a mysql table for uk people that includes:
- postcode beginning (i.e. BB2)
- latitude (int)
- longitude (int)
- range (int, in miles, 1-20)
http://www.easypeasy.com/guides/article.php?article=64 - theres the article for the sql file i based my table on
now it says i can use Pythagoras theorem to calculate distances based on longitude and latitude.
so lets say i wanted to select all the people who are in range (based on the 1-20 they enter in the range field) of a postcode beginning i search for
for example, lets say i search for "BB2", i want a query that will select all of the people whose postcode beginning is "BB2", AND all the people within range of BB2 (going by the 1-20 mile range in their database field).
can some math whiz help me out?