This is my query to calculate distance using latitude longitude values .
SELECT mm.mem_id, mm.profilenam, mm.photo_thumb, mm.city, mm.zip, mm.country, mm.state, ( 3956 *2 * ASIN( SQRT( POWER( SIN( ( 34.1012181 - ABS( latitude ) ) * PI( ) /180 /2 ) , 2 ) + COS( 34.1012181 * PI( ) /180 ) * COS( ABS( latitude ) * PI( ) /180 ) * POWER( SIN( (
ABS( - 118.325739 ) - ABS( longitude ) ) * PI( ) /180 /2 ) , 2 ) ) )
) AS distance
FROM members AS mm
WHERE mm.profile_type = 'C'
ORDER BY distance
LIMIT 0 , 10
i want the distance < 500 but when i put in query
… <500 AS distance , it doesn’t work
How can i get the final query.
Have you tried