','>',$xmlStr); $xmlStr=str_replace('"','"',$xmlStr); $xmlStr=str_replace("'",''',$xmlStr); $xmlStr=str_replace("&",'&',$xmlStr); return $xmlStr; } // 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()); } // Select all the rows in the markers table $query = "SELECT * FROM gforum_Fitters WHERE fitter_lat <> 0 AND fitter_lng <> 0"; $result = mysql_query($query); if (!$result) { die('Invalid query: ' . mysql_error()); } // Start XML file, echo parent node echo ''.PHP_EOL; echo ''.PHP_EOL; // Iterate through the rows, printing XML nodes for each while ($row = @mysql_fetch_assoc($result)){ // ADD TO XML DOCUMENT NODE echo ''.PHP_EOL; } // End XML file echo ''; ?>