Ok I have a database with about 1800 rows, each has a column lat and long, what I am trying to do, it query against Google Maps V3 .getBounds
lat
long
.getBounds
This works for me:
$condition1 = $a < $c ? "lat > $a AND lat < $c" : "lat > $a OR lat < $c"; $condition2 = $b < $d ? "lon > $b AND lon < $d" : "lon > $d OR lon < $b"; $q = "SELECT * FROM tilistings WHERE ( $condition1 ) AND ( $condition2 )";