Hi,
I'm importing xml formatted data from mysql via php script:
[code]
<?php
require_once('require.php');
$result = mysql_query("SELECT * FROM `songs`");
if($result)
{
header ("Content-Type: text/xml");
echo"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo"<songComments>\n";
while ($row = mysql_fetch_array($result))
{
echo"<testimonial>\n";
echo"<songComment>" . $row['title'] . "</songComment>\n";
echo"</testimonial>\n";
}
echo"</songComments>\n";
}
?>
[/code]
In one of my flash projects it's working just fine. But in the new one that I just sterted not anymore. And i have no idea why. I get this errors:
TypeError: Error #1085: The element type "songComments\n" must be terminated by the matching end-tag "</songComments\n>".
or:
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
When I output that php into txt file and loaded in flash everything is fine, but not from php script directly.
Could it have something to do with that I'm testing that mysql locally on my computer using WAMP ? Previous project got all data from mysql from server.
Ho could I trace what flash sees?
var url:URLLoader = new URLLoader();
url.addEventListener(Event.COMPLETE, xmlLoaded);
url.load(new URLRequest("getDataFromDB.php"));
private function xmlLoaded(event:Event):void {
myXML = new XML(event.target.data);
trace(myXML);
}
I got rid of that \n everywhere or move them around and it's still the same error 1088 or 1085
North America
Europe, Middle East and Africa
Asia Pacific