Data not pulled from mysql at particular zoom level laone
Between command not working correctly for geo coordinates
Select * from table_name where loc_lng BETWEEN $ln2 AND $ln1 AND loc_lat BETWEEN $la2 AND $la1
The code works perfectly fine when $ln2 is smaller than $ln1 and $la2 is smaller than $la1, but it dosent work when the values $ln1 is greater than $ln2 and $la1 is greater than $la2. The ln and la are geo coordinates so sometimes one will be bigger than the other.
That's to be expected. You need additional logic to define the minLatitude, maxLatitude, minLongitude and maxLongitude BEFORE you pass the values to the query.
Then your query can be
Select * from table_name where loc_lng BETWEEN $minLongitude AND $maxLongitude AND loc_lat BETWEEN $minLatitude AND $maxLatitude