Advertisement

04.07.2008 at 04:53AM PDT, ID: 23301016 | Points: 500
[x]
Attachment Details

Post code distance calculation (php and mysql)

Asked by mattaob in PHP and Databases, PHP Scripting Language, MySQL Server

Tags:

Hello folks.

I have a postcode database:
Structure is:

postcode
x
y


The formula to calculate the (approximate) distance in miles,  a straight line is apparently:
sqrt(pow(($a_x-$b_x), 2) + pow(($a_y-$b_y),2))*0.0006;


What I'd like to do is when someone enters their postcode, eg: SW1 to be able to query the postcode and return the distances to the other postcodes with x miiles.

To summaries: I want to execute a query that returns all the postcodes within 10 miles of SW1Start Free Trial
[+][-]04.07.2008 at 06:26AM PDT, ID: 21296608

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 06:57AM PDT, ID: 21296901

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 06:58AM PDT, ID: 21296910

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 06:59AM PDT, ID: 21296924

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 07:02AM PDT, ID: 21296961

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 07:18AM PDT, ID: 21297113

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 08:03AM PDT, ID: 21297590

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628