On Aug 10, 12:00 pm, Jacob Roman <[email protected]> wrote: > I did search for some help on this but nothing is really helping me. I > have changed the database, the xml script, and the map code. I do not > know what else to change to make it show up. Visit this link to see > the map
http://frykrisp.co/distributors/phpsqlsearch_map.html I get a key error on that map. Your xml seems fine: http://frykrisp.co/distributors/phpsqlsearch_genxml.php?lat=36.778261&lng=-119.4179324&radius=200 But there are no phone numbers in it... phone="" (for all the entries) So the problem is in your xml generation or your database. -- Larry > > If you put the address CA and set the radius to 200 some markers will > show up. > > My HTML code you can see by viewing the source through the browser > > The only other thing i can think of is i did not do MySQL the right > way. > > Below is my php code: > > <?php > require("phpsqlsearch_dbinfo.php"); > > // Get parameters from URL > $center_lat = $_GET["lat"]; > $center_lng = $_GET["lng"]; > $radius = $_GET["radius"]; > > // Start XML file, create parent node > $dom = new DOMDocument("1.0"); > $node = $dom->createElement("markers"); > $parnode = $dom->appendChild($node); > > // Opens a connection to a mySQL server > $connection=mysql_connect ($host, $username, $password); > if (!$connection) { > die("Not connected : " . mysql_error()); > > } > > // Set the active mySQL database > $db_selected = mysql_select_db($database, $connection); > if (!$db_selected) { > die ("Can\'t use db : " . mysql_error()); > > } > > // Search the rows in the markers table > $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); > > $result = mysql_query($query); > if (!$result) { > die("Invalid query: " . mysql_error()); > > } > > header("Content-type: text/xml"); > > // Iterate through the rows, adding XML nodes for each > while ($row = @mysql_fetch_assoc($result)){ > $node = $dom->createElement("marker"); > $newnode = $parnode->appendChild($node); > $newnode->setAttribute("name", $row['name']); > $newnode->setAttribute("address", $row['address']); > $newnode->setAttribute("phone", $row['phone']); > $newnode->setAttribute("lat", $row['lat']); > $newnode->setAttribute("lng", $row['lng']); > $newnode->setAttribute("distance", $row['distance']); > > } > > echo $dom->saveXML(); > ?> > > On Aug 2, 12:10 pm, "[email protected]" <[email protected]> > wrote: > > > On Aug 2, 8:43 am, Jacob Roman <[email protected]> wrote: > > > >http://www.frykrisp.uphero.com/distributors/map/phpsqlsearch_map.html > > > > Above is a link to theStorelocatori have created following this > > > tutorial.http://code.google.com/apis/maps/articles/phpsqlsearch.html > > > > I would like to add more information to theinfobubbles that pop up > > > when you click on the markers. Such as a telephone number and possibly > > > a link to a website. I have tried adding it to MySQL, but it did not > > > work. How would i go about doing this? > > > You need to add the information to: > > 1. the database > > 2. the xml script > > 3. the map code. > > > (Did you try searching, I think this is a common question. I didn't > > look, but I remember it coming up before) > > > -- Larry -- 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.
