How to populate my store list based on user location so that the nearest store should come first. i.e. shorted by nearest.
Say you have your customer_lat, customer_long
SELECT latitude, longitude, SQRT(
POW(69.1 * (latitude -$customer_lat), 2) +
POW(69.1 * ($customer_long – longitude) * COS(latitude / 57.3), 2)) AS distance
FROM TableName ORDER BY distance;