Hello
I have a database that I store some data. I want to view this data in my flash project.
The text is not appearing the way it should. For some reason its adding for each enter one more enter than it should.
I have a php file that takes the data from the database and it makes an XML structure code.
For example:
----------------------------The way the text should be written---------------------------------
Hello world
Hello world
-----------------------------And this is how the text is appearing-----------------------------------------------
Hello world
Hello world
----------------------------------------------------------------
If you have any idea please help ! ! !
Thank you
Actionsctipt:
Code:
var theXML:XML = new XML();
theXML.ignoreWhite = true;
theXML.onLoad = function() {
var nodes:Array = theXML.firstChild.childNodes;
for(i=0; i<nodes.length; i++) {
my_txt2.text += nodes[i].firstChild.nodeValue + "\n";
}
}
theXML.load("http://localhost/PrimeMarine/prime TEST/1/con_flash4.php")
php script:
Code:
<?php
require("config.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
mysql_select_db($db_name, $connection);
$query = "SELECT * from news ORDER BY month desc";
$result = mysql_query($query, $connection);
echo "<?xml version=\"1.0\"?>\n";
echo "<comments>\n";
while ($line = mysql_fetch_assoc($result)) {
echo "<item>" . $line["comments"] . "</item>\n";
}
echo "</comments>\n";
?>