Hello, I am a newbie at php 😃, anyway I am trying to make my google map mark a spot on the map, and to get the longitude and latitude from a table, here is the code I picked up from another person
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAbaFdNtoImpKKOcfBCb_8OBTVV6Nm0EYMs4Nmu9_cYoW7H7T1thRr91VqzOCzWjbL-HO8shohoWA5ow"
type="text/javascript"></script>
<script type="text/javascript">
//<CDATA>setMapType('G_HYBRID_TYPE');
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(134.132080078125, -25.770059260080004), 13);
map.setMapType(G_SATELLITE_TYPE);
// Creates a marker whose info window displays the given number
function createMarker(point, number)
{
var marker = new GMarker(point);
// Show this markers index in the info window when it is clicked
var html = number;
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
return marker;
};
echo "var point = new GPoint(" . $row['lon'] . "," . $row['lat'] . ");\n";
echo "var marker = createMarker(point, '" . $info . "');\n";
echo "map.addOverlay(marker);\n";
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 600px; height: 400px"></div>
</body>
</html>
Now I am wondering about the 3 echo's, how do I make them echo from my mysql database (I have a database with a username and password and a host name)
Thank you,
Darko