php - Data not pulled from mysql at particular zoom level laone -


between command not working correctly geo coordinates

select * table_name loc_lng between $ln2 , $ln1 , loc_lat between $la2 , $la1 

the code works fine when $ln2 smaller $ln1 , $la2 smaller $la1, dosent work when values $ln1 greater $ln2 , $la1 greater $la2. ln , la geo coordinates 1 bigger other.

that's expected. need additional logic define minlatitude, maxlatitude, minlongitude , maxlongitude before pass values query.

then query can be

select * table_name loc_lng between $minlongitude , $maxlongitude , loc_lat between $minlatitude , $maxlatitude 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -