We have used the store example from - 
http://code.google.com/apis/maps/articles/phpsqlsearch_v3.html,
when we have executed the MySql query we got the following results -

MySql query -
SELECT *, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) *
cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin
( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25
ORDER BY distance LIMIT 0 , 5;

MySql Result -
170     Giorgio's       1445 Foxworthy Ave, San Jose, CA        37.274648       
-121.892893
19.873459500007
171     Round Table Pizza       4302 Moorpark Ave, San Jose, CA
37.315903       -121.977925     21.861958724648
164     Pizza Antica    334 Santana Row # 1065, San Jose, CA
37.321792       -121.947735     22.420540961196
169     Tony & Alba's Pizza & Pasta     3137 Stevens Creek Blvd, San Jose, CA
37.323297       -121.951646     22.497168114088
166     House of Pizza  527 S Almaden Ave, San Jose, CA
37.326353       -121.888165     23.375948393304

We have converted the above MySql query to SQL query as -
select top 5 * from (SELECT *, ( 3959 * acos( cos( radians(37) ) * cos
( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin
( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM maps ) as
results where distance < 10000

SQL Result -
Frankie Johnnie &amp; amp;  Luigo Too   939 W El Camino Real, Mountain
View, CA        37.386339       -122.085823     2627.24169360985
Amici&#39; s East Coast Pizzeria        790 Castro St, Mountain View, CA
37.38714        -122.083235     2627.26570574024
Kapp&#39; s Pizza Bar &amp;  Grill      191 Castro St, Mountain View, CA
37.393885       -122.078916     2627.67104510094
Round Table Pizza: Mountain View        570 N Shoreline Blvd, Mountain View,
CA      37.402653       -122.079354     2628.26827177072
Tony &amp;  Alba&#39; s Pizza &amp;  Pasta      619 Escuela Ave, Mountain
View, CA        37.394011       -122.095528     2627.87265448319

Both the distance values from MySql and SQL are not same as given in
the google example, dont know why, google example is also not working.

Please help me to solve this issue.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to