I am developing a website in which i want to give a search functionality for user..the search feature will detect the users current location and will show all the business within 10 kilometer from the user’s current location..
businesses are stored in database..
please can anyone help me?
I am developing a website in which i want to give a search functionality
Share
Have your database store longitude and latitude coordinates for all the business entries, then get the users location in long/lat and use the Euclidean distance which you can write into a SQL query. If you want to get more accurate, you can use the Haversine formula instead though it is a bit more complex.