Location: PHPKode > projects > Wiki-Map > htdocs/points.php
<?
// Supply data to map
require_once('openDB.php');

if ($_COOKIE[z] < 5){
	$sql = "SELECT `lat`,`long`,`city`,'city' FROM cities";
} else {
	$sql = "SELECT latitude,longitude,s_desc,type from waypoints ORDER BY `waypoints`.`datestamp` DESC LIMIT 30";
}
$result = mysql_query($sql);
if (!$result){
			echo '** Creation falied ** <BR>'.mysql_error().'<BR>\n';
			exit;
	}
	/*
// Download the data in data.xml and load it on the map. The format we
// expect is:
// <markers>
//   <marker lat="37.441" lng="-122.141" />
//   <marker lat="37.322" lng="-121.213"/>
// </markers>
*/
echo "<markers>\n";

while ($r=mysql_fetch_row($result)){
	echo "<marker lat=\"$r[0]\"  lng=\"$r[1]\"  desc=\"$r[2]\" type=\"$r[3]\" />\n";
}
echo "</markers>\n";

?>
Return current item: Wiki-Map