I have a master zip code table tbl_zipcode with all latitude and longitude values. Also a restaurant table with restaurant list with zip codes.
Now I want to show the restaurants within 100 miles from user location i.e. from session user. How can I write a function which returns all the restaurants within 100 miles?
Any help is appreciated!!
Thanks.
So basically you have the longitude and latitude of the user and of all the restaurants..
check haversine formula
this is helpful: http://www.movable-type.co.uk/scripts/latlong.html
To implement the formula is pretty simple