flash data integration:
Hi I'm trying to make a news viewing function in Flash 8. The swf calls out a
php script, php script queries the MySQL DB then php sends info to swf file to
display it. Unfortunately, the articles don't display and I keep getting
"undefined" errors. I don't have this problem when I tested it on my PC but
after upoading it to my host the problem arose.
I hope someone can help me. Thanks!
this is the script i used in flash 8 to call out the PHP script:
function getData(ref) {
sectionContent = new LoadVars();
sectionContent.ignoreWhite = true;
sectionContent.onLoad = function(success) {
wait._visible = false;
if (success) {
pressHead.text = this.headline;
var newsPic = this.picture;
var picEmbed = '<img src='+'"'+'images/press/'+this.picture+'"'+'
align="left">';
contentText.html = true;
contentText.htmlText = picEmbed+this.article;
calcSize();
gotoAndPlay(56);
}
};
sectionContent.load("jpg/media.php?row="+ref);
}
this is the script i used in php:
<?
$connect = mysql_connect("localhost", "admin", "password");
mysql_select_db("mydb", $connect);
$sql="SELECT * FROM tbl_press_release";
$result=mysql_query($sql);
$row=mysql_fetch_assoc($result);
if(isset($_GET[$row])){
mysql_query("SELECT * FROM tbl_press_release Where
press_release=".$_GET[$row]."");
}
?>
<? echo "&headline=" . $row["headline"] . " &article=".$row['article']."
&picture=" . $row['image'] . ?>
<?
} mysql_free_result($result);
mysql_close($connect);
?>