$limit_ea = 15;
$limit_start = (!empty($_POST['limitStart'])) ? ($limit_ea * $_POST['limitStart']) : 0;

 

# 쿼리
$m100 = 0.000750;
$geox= trim($_POST['geox']);
$geoy= trim($_POST['geoy']);
$geoxy = ($m100*5) *1000; // 5Km

 

# 총레코드
$total = $mysqli->get_total_record(_TABLE_,"( 3959 * acos( cos( radians('{$geox}') ) * cos( radians(geox ) ) * cos( radians(geoy) - radians('{$geoy}') ) + sin( radians('{$geox}') ) * sin( radians(geox) ) ) ) as distance < {$geoxy}");


$qry = "SELECT uid,geox,geoy,( 3959 * acos( cos( radians('{$geox}') ) * cos( radians(geox) ) * cos( radians(geoy) - radians('{$geoy}') ) + sin( radians('{$geox}') ) * sin( radians(geox) ) ) ) as distance FROM "._TABLE_." HAVING distance<{$geoxy} ORDER BY distance ASC LIMIT ".$limit_start.','.$limit_ea;

$result = $mysqli->query($qry);
while($list = $result->fetch_assoc()){

}


'PHP 프로그래밍' 카테고리의 다른 글

euc-kr에서 독일어  (0) 2018.01.08
그누보드 자동로그인  (0) 2018.01.08
[그누보드] 외부로그인 핸드폰인증  (0) 2017.12.29
php include 된 파일 파악  (0) 2017.12.29
Fatal error : Allowed memory size of 에러  (0) 2017.12.28

+ Recent posts