simple ordering lat long MySQL
SELECT
*,
6371 * ASIN(
SQRT(
POWER( SIN( ( '-8.637420' - sample.lat ) * pi( ) / 180 / 2 ), 2 ) + COS( '-8.637420' * pi( ) / 180 ) * COS( sample.lat * pi( ) / 180 ) * POWER( SIN( ( '115.253001' - sample.lng ) * pi( ) / 180 / 2 ), 2 )
)
) AS distance
FROM
sample
ORDER BY
distance ASC