Jump to content

[SOLVED] Intro Outro ORDER


jaymc

Recommended Posts

Lets say I have a table, in that table there is a field where a number can be between 0-100,000

 

I want to pull out all records closest to a number I specify

 

For instance if the number I specify is 800, it should return

 

799, 801, 798, 802, 797, 803

 

NOT 801, 802, 803 or vice versa which is what I would get using a standard order.

 

I cant use BETWEEN or < > because the closest number to a number I specify maybe 350 digits away, its dynamic

 

Just think of it as a program which calculates the 10 closest people to someone standing directly in the middle of a circle. Each time you load the script the position of the people are different, hence cant use BETWEEN etc

 

Im actually using this to calculate the people closest to a postcode based on long and lat, but the circle example will surfice!

 

Any ideas on the best way to do this in pure MYSQL

Link to comment
https://forums.phpfreaks.com/topic/118370-solved-intro-outro-order/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.