I have a table that has two fields (latitude and longitude). I also have a script that gets the users current latitude and longitude.
I want to get all the rows from the table that are <= 50Km from the users location. Calculating the distance is not a problem. My question is how do I restrict unwanted rows in my search result using mysql?
$currentLatitude = 10.999;
$currentLongitude = 23.354;
MYSQL
$this->db->select('latitude, longitude');
$this->db->from('table');
//This is where I have a problem
$this->db->where('distance <=', 50km);
$result = $this->db->get()