function Load_taradod($latitude, $longitude) { $array = array(); $latitudenow = round($latitude, 4); $longitudenow = round($longitude, 4); $sql0 = "SELECT * FROM tbl_location WHERE status = 1 AND (ABS(FLOOR(ROUND(SUBSTRING_INDEX(loc_order, ',', 1), 4) * 10000) / 10000 - :latitudenow) < 0.0001 AND ABS(FLOOR(ROUND(SUBSTRING_INDEX(loc_order, ',', -1), 4) * 10000) / 10000 - :longitudenow) < 0.0001) ORDER BY id ASC"; $stmt0 = $this->conn->prepare($sql0); $stmt0->bindParam(':latitudenow', $latitudenow); $stmt0->bindParam(':longitudenow', $longitudenow); $stmt0->execute(); $link = $stmt0->fetchAll(PDO::FETCH_ASSOC); if (!empty($link)) { $array = end($link); $array['status'] = "OK"; } else { $array['status'] = "error"; } echo json_encode($array); }