http://www.jet-hot.com/Dist_Locator/map1.html

I am having a couple issues with Google Maps and trying to create a
page that you can enter an address and it will give you the closest 20
locations.  I've uploaded all the info into my database.  I can't use
the DOM function because I don't believe I'm using PHP5, so I have to
use the echo function.  The first issue I had was an error with the
following script that is made to parse info to an xml file:

$query = sprintf("SELECT address, name, lat, lng, ( 3959 * acos( cos
( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) -
radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS
distance FROM markers HAVING distance < '%s' ORDER BY distance LIMIT
0 , 20",
  mysql_real_escape_string($center_lat),
  mysql_real_escape_string($center_lng),
  mysql_real_escape_string($center_lat),
  mysql_real_escape_string($radius));

$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());

It's giving me an error that the first line: mysql_real_escape_string
- Call to undefined function.  So I took those 4 lines out, and if I
manually enter a lat & lng in the $query line above, it will print the
xml file with all the info from my database, including distance when I
open it in a browser.

However, in the main html file, it seems like it is not pulling any
info from the xml file, so I keep coming up with "No record found"
when I enter an address.  I can manually add the lat & lng (in the
areas with '%s') and when I open the page and enter an address it will
give me the closest 20 locations, but from the information I manually
entered into the code, not from the address I entered, obviously.

It seems like it's not pulling information from the xml page like it's
supposed to to find the lat and longitude for the address entered.
I'm thinking it has something to do with the file I use to generate
the xml.

Any suggestions?


--~--~---------~--~----~------------~-------~--~----~
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