$stmt = $pdodb->prepare("SELECT field1, field2, SQRT(
POW(69.1 * (dblat - :dblat), 2) +
POW(69.1 * (:dblon - dblon) * COS(dblat / 57.3), 2)) AS distance
FROM tablename HAVING distance < :distance");
$stmt->bindParam(':dblat', $lat);
$stmt->bindParam(':dblon', $lon);
$stmt->bindParam(':distance', $distance); // in miles
$stmt->execute();