Código PHP:
<?php
$link = mysql_connect("xxxxxx", "xxxxx", "xxxxx") or die("Could not connect: " . mysql_error());
mysql_selectdb("mibd",$link) or die ("Can\'t use dbmapserver : " . mysql_error());
$result = mysql_query("SELECT
`wp_geopress`.*, `wp_postmeta`.*, `wp_posts`.*
FROM
`wp_geopress` INNER JOIN
`wp_postmeta` ON `wp_geopress`.`geopress_id` = `wp_postmeta`.`meta_value`
INNER JOIN
`wp_posts` ON `wp_postmeta`.`post_id` = `wp_posts`.`post_parent`;",$link);
if (!$result)
{
echo "no results ";
}
while($row = mysql_fetch_array($result))
{
$ptmcord=$row['coord'];
$ptmcord = str_replace(" ", ", ", $ptmcord);
$nombre = "<table align=center><tr><td><a href=http://miweb.com/rt/?p=".$row['post_id'].">".$row['loc']."<br><img src=".$row['guid']." width=120 height=80></a></td></tr></table>";
echo "var point = new GLatLng(" . $ptmcord . ");\n";
echo "var marker = createMarker(point, '" .$nombre . "');\n";
echo "map.addOverlay(marker);\n";
echo "\n";
}
mysql_close($link);
?>