Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ChrisF79's avatar

How would I create this query based on a method I have?

I have a site I'm working on that will find music teachers near students. The student can look for teachers by choosing a distance from their address.

I have a method calculate() that will take two latitude/longitude coordinates and calcualte the distance between the two points. It works great.

How do I create a query that will find all of the teachers with lat/long within a distance from the student?

Thank you

0 likes
2 replies

Please or to participate in this conversation.