I have a coordinate. I want to find the top "n" (n being a variable value) nearest coordinates out of several thousand rows stored on a MySQL database. I also want to be able to define maximum and minimum distances between the coordinate in question and the coordinates in the database.
How best am I to go about this? Would it be bonkers to use PHP as I understand the syntax much better than MySQL?
If I use a MySQL function, how do I move it between databases if I choose to switch servers? How is it stored?
Lastly, what is the most efficient method of getting through all these coordinates accurately - the coordinates are all relatively close to one another?
Thanks for your time,
John.