I am working on an iOS app which I need to pull locations from my database that are within a certain radius of the users location using longitudes and latitudes. I have a function that will determine the distance between two longitudes and latitudes in my php file. My thought was maybe I could try to pass the longitude and latitude of the users location to the php query then use that data and basically do a WHERE clause that would be if the distance found with that distance function was less than the radius I need to search. Is this possible? Is there a way to pass that kind of data form my objective C file to my php file? I am very new to databases so bear with me. Thanks!
To solve this problem you need to send request in post or get method . then get the value from the post or get method . example: suppose your data in a server and your server name example.com then send longitudes and latitudes request using get method www.example.com?longitudes = 1000&latitudes = 5000;
in your php file get data that comes in get method
$longitudes = $_GET['longitudes '];
$latitudes = $_GET['latitudes '];
the send this variable in your where condition , then your problem is solved