How to pass variable in mysql query Trying to fetch latitude and longitude

0 votes
long='73.9876'

lati='18.6543'

query="SELECT user_id ,SQRT(POW(69.1 * (latitude - lati), 2) + POW(69.1 * (longi - longitude) * COS(latitude / 57.3), 2)) AS distance from users HAVING distance < 30 ORDER BY distance where latitude=%s AND longitude=%s"

#### value of lati and longi will be user defined, how I will make it dynamic. please help me to resolve this problem. thanks in advance.
Mar 3, 2021 in Python by rehan
• 160 points

edited Mar 4 49 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP