I'm trying to parse data from mysql to xml. To use it for create markers on a Google Map. But I have a problem. When in the column of mysql I use html like it crashes.
Mi code is:
$query = "SELECT * FROM mapas";
$resultado = mysql_query($query);
$row = mysql_fetch_assoc($resultado);
header("Content-Type: text/xml;charset=iso-8859-1");
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<markers xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
do{
echo'<marker id="'.$row["id"].'" lat="'.$row["lat"].'" lng="'.$row["lng"].'" title="'.$row["title"].'" content="'.$row["content"].'" icon="'.$row["icon"].'"/>';
}while($row=mysql_fetch_assoc($resultado));
echo '</markers>';
?>
When I access to the page to see the xml the problem shown is:
This page contains the following errors:
error on line 1 at column 137: Unescaped '<' not allowed in attributes values Below is a rendering of the page up to the first error.
In Mysql the structure of the column is: Type: Text, uf8-general-ci....
If I use just text I have no problem at all. ¿Could you help me?
Thank you!