Ok so I have the following two columns in my database table with the following long/lat.
longitude - "-2.2426305000000184,0.7077123000000256"
latitude - "53.4807593,51.5459269"
I have this query so far:
function getResults($lat, $long) {
$query=$this->db->query("SELECT *, (3959 * acos(cos(radians('".$lat."')) * cos(radians(latitude)) * cos( radians(longitude) - radians('".$long."')) + sin(radians('".$lat."')) *
sin(radians(latitude))))
AS distance
FROM ads HAVING distance < 15 ORDER BY distance LIMIT 0 , 10");
return $query->result();
}
The problem is that my longitude and latitude columns are arrays.
The user enters the longitude and latitude in a search bar and it should return results. I'm finding it difficult to query this since the longitude and latitude columns are arrays.