Closed jdanielcmedina closed 3 years ago
I add this function inside Medoo class and works good. I need put inside class because I need use WHERE clause function....
public function distance($table, $latitude = 0, $longitude = 0, $where = null){
$query = $this->query('SELECT id
, (((ACOS(SIN((' . $latitude . ' * PI()/180)) * SIN((latitude
* PI()/180)) + COS((' . $latitude . ' * PI()/180)) * COS((latitude
* PI()/180)) * COS(((' . $longitude . ' - longitude
) * PI()/180)))) * 180/PI()) * 60 * 1.1515 * 1.609344) AS distance
FROM users ' . $this->where_clause($where));
return $query->fetchAll(PDO::FETCH_ASSOC);
}
Hi, I need use this with Medoo.
But I want use like this... $database->get('users', '*', [?????]);
Thanks...