Monday, May 22, 2017

SQL Check if coordinates are within radius of database coordinates

I have a table containing smallInteger radius_size, varchar radius_lat and varchar radius_lng and I'm trying to make an Eloquent query where I can pass in a lat and lng value and get all records where the provided lat and lng fall into the record's radius from it's lat and lng, but the can't figure it out and the examples I find with similar cases or in other languages don't seem to help me.

Anyone have an idea?



via Feanor

Advertisement