Fatal error: Call to undefined function parseToXML()

Good day , I wish I could support with this error that is generating me , according to a talk with a partner of this forum the error might be in the function declaration parseToXML so if someone has gone through a similar situation to them agradecere much I could support , thank you, greetings ! //Select all the rows in the markers table
$query=“SELECT*FROM cursos_promocion WHERE NombreCurso=’”.[TipoCurso]."’";
sc_select (result,$query);
if({result}===false)
{
sc_error_message (“Error on retrieve dates. Error message=”.{result});
}
else
{
header (“Content - type: string/xml”);
//Start XML file, echo parent node
echo ‘<markers>’;

//Iterate through the rows, printing XML nodes for each
while (!$result->EOF)
{
echo ‘<marker ‘;
echo ‘Plantel="’.parseToXML($result->fields[‘Plantel’]).’" ‘;
echo ‘Especialidad="’.parseToXML($result->fields[‘Especialidad’]).’" ‘;
echo ‘Latitud="’.$result->fields[‘Latitud’].’" ‘;
echo ‘Longitud="’.$result->fields[‘Longitud’].’" ‘;
echo ‘NombreCurso="’.$result->fields[‘NombreCurso’].’"’;
echo ‘/>’;
$result->MoveNext();
}
$result->Close();
//End XML file
echo ‘</markers>’;
}

Hi, did you create the function ParseToXML? I found a function for that.
function parseToXML($htmlStr) { $xmlStr=str_replace(’<’,’<’,$htmlStr); $xmlStr=str_replace(’>’,’>’,$xmlStr); $xmlStr=str_replace(’"’,’"’,$xmlStr); $xmlStr=str_replace("’",’’’,$xmlStr); $xmlStr=str_replace("&",’&’,$xmlStr); return $xmlStr; }

This is a link from a forum with some information about your question.
http://stackoverflow.com/questions/9550739/outputting-xml-via-php-and-sql

[SIZE=16px]Alvargar thank you very much , I’ll try it I hope it is resolved as I have the time and over again I thank the support , really it is a pleasure to know that there is a community where people we can rely starting[/SIZE]

Ok Luis. Gracias.

Ya realice el c?digo y ya declare la funci?n y ya funciona el c?digo pero ahora no me trae datos, mi pregunta es si sera necesario poner el c?digo de conexi?n con la base de datos.
// Opens a connection to a MySQL server $connection=mysql_connect (‘localhost’, $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());}

Use la Macro de SC sc_select (result,$query); y verifique que la consulta est? trayendo los datos correctamente.

Muevo el hilo al subforo espa?ol.

Ya funciona la consulta si trae los datos pero no genera el xml, me hace falta activar una librer?a?

function parseToXML($htmlStr)
{
$xmlStr=str_replace(’<’,’<’,$htmlStr);
$xmlStr=str_replace(’>’,’>’,$xmlStr);
$xmlStr=str_replace(’"’,’"’,$xmlStr);
$xmlStr=str_replace("’",’’’,$xmlStr);
$xmlStr=str_replace("&",’&’,$xmlStr);
return $xmlStr;
}

//Select all the rows in the markers table
$query = “SELECT * FROM cursos_promocion WHERE NombreCurso=’”.[location_type]."’";
sc_select (result,$query);
if({result}===false)
{
sc_error_message (“Error on retrieve dates. Error message=”.{result});
}
else
{
header (“Content - type: text/xml”);
//Start XML file, echo parent node
echo ‘<markers>’;

//Iterate through the rows, printing XML nodes for each
while (!$result->EOF)
{
echo ‘<marker ‘;
echo ‘Plantel="’.parseToXML($result->fields[‘Plantel’]).’" ‘;
echo ‘Especialidad="’.parseToXML($result->fields[‘Especialidad’]).’" ‘;
echo ‘Latitud="’.$result->fields[‘Latitud’].’" ‘;
echo ‘Longitud="’.$result->fields[‘Longitud’].’" ‘;
echo ‘NombreCurso="’.$result->fields[‘NombreCurso’].’"’;
echo ‘/>’;
$result->MoveNext();
}
$result->Close();
//End XML file
echo ‘</markers>’;
}

Hola, tu no estas generando el archivo a trav?s del script. solo estas haciendo echo para escribirlo en pantalla.
Aquie te explican como generar el archivo.
http://www.ribosomatic.com/articulos/agregar-marcas-en-google-maps-con-un-formulario-html/