Showing posts with label nearest place. Show all posts
Showing posts with label nearest place. Show all posts

Wednesday, 24 April 2013

To get distance based on latitude & longitude calculate in Mysql query

SELECT DISTINCT ( a.categoryID ), a.categoryName, a.imgFile, MIN( 3959 * ACOS( COS( RADIANS( 11.0168445 ) ) * COS( RADIANS( c.lattitude ) ) * COS( RADIANS( c.longitude ) - RADIANS( 76.9558321 ) ) + SIN( RADIANS( 11.0168445 ) ) * SIN( RADIANS( 11.0168445 ) ) ) ) AS distance