Dear anfetienne,
I hope you know that the flash cannot directly take data from mysql. it can take data as xml or variables... in case of large data we prefer xml.
So all you have to do is to echo the data with a php as an xml. You see the below example...
-
newsfeed.php
-
-
<?php
-
header('Content-Type: text/xml');
-
echo '<?xml version="1.0"?>
-
<doc xml:base="http://thenewsflash.net/" xmlns:xlink="http://www.w3.org/1999/xlink">';
-
$query = "SELECT ddate,heading,matter FROM news ORDER BY ddate DESC";
-
$result = mysql_query($query,$link) or die('Fatal error occured! Inform <a href="mailto:webmaster@thenewsflash.net">webmaster</a>');
-
$rec = mysql_num_rows($result);
-
echo ' <news totrec="'.$rec.'">';
-
$i= 1;
-
while ($row = mysql_fetch_assoc($result)) {
-
$matq=$row["matter"];
-
$matq=str_replace ("\r\n","<br>",$matq);
-
$matq=htmlspecialchars($matq,ENT_QUOTES);
-
echo ' <newsrow id="'.$i.'" heading="'.$row["heading"].'" date="'.$ddate.'" mattr="'.$matq.'"/>';
-
$i++;
-
}
-
mysql_free_result($result);
-
mysql_close($link);
-
echo ' </news>
-
</doc>';
-
?>
-
and replace xmlData.load("newsfeed.xml") to xmlData.load(newsfeed.php)