Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

distance calculator from lat long sql query

COALESCE(
  	( 
      6371 * acos( cos( radians({$latitude}) ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians({$longitude}) ) + sin( radians({$latitude}) ) * sin( radians( `latitude` ) ) ) 
    )
  , 0) AS distance
 
PREVIOUS NEXT
Tagged: #distance #calculator #lat #long #sql #query
ADD COMMENT
Topic
Name
2+2 =