I tried the select statement idea, but it didn't work.
$part1 = cos(deg2rad($lat)) cos(deg2rad($long)) cos(deg2rad(latitude)) cos(deg2rad(longitude));
$part2 = cos(deg2rad($lat)) sin(deg2rad($long)) cos(deg2rad(latitude)) sin(deg2rad(longitude));
$part1 = sin(deg2rad($lat)) sin(deg2rad($long));
$EQN = acos($part1 + $part2 + $part3) 3959;
$query = "SELECT latitude, longitude FROM zipcodes WHERE $EQN<$x";
latitude, longitude are columns inside the table, and $lat, $long, $x are constants.
The select statement does not return any values.
Can anybody see anything wrong with the above?