Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel count distance lat/longtidue

$lat = 41.118491 // user's latitude
$lng = 25.404509 // user's longitude

SELECT *, 
( 6371 * acos( cos( radians($lat) ) 
* cos( radians( latitude ) ) 
* cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) 
* sin( radians( latitude ) ) ) ) 
AS calculated_distance 
FROM settings as T 
HAVING calculated_distance <= (SELECT distance FROM settings WHERE sid=T.sid) 
ORDER BY distance_calc
Comment

PREVIOUS NEXT
Code Example
Php :: convert datetime to string in php 
Php :: php slice last arrat 
Php :: laravel switch 
Php :: laravel validation not equal to 
Php :: insertion sort in php 
Php :: today date to ago for the date in php 
Php :: php json data to array 
Php :: update php version wamp windows 
Php :: excerpt with Laravel 
Php :: laravel upload file to aws s3 
Php :: how to get meta information from pagination in laravel controller 
Php :: how to execute php function on button click 
Php :: The media must not be greater than 12288 kilobytes in laravel 
Php :: file_get_content 
Php :: how to clear php form data after submit 
Php :: laravel validate form data unique 
Php :: real time update using ajax php 
Php :: Delete a single record in laravel 5 
Php :: message get with return action laravel 
Php :: if exists in string count php 
Php :: use smarty variable in php 
Php :: laravel using username instead of email 
Php :: find value in array php 
Php :: wordpress enable post thumbnail 
Php :: Arr::only laravel 
Php :: withsuccess laravel 8 
Php :: php hour between 
Php :: php mysql prepared statements 
Php :: php list *files 
Php :: php get first element of iterator class 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =