Showing multiple variable from PHP in Flash (content= persistant after first entry)

I wasn’t sure if I should start up a thread for something that already semi-exist…but my problem started after the solution I’ve found for another problem in this thread here. I altered the codes a bit so I can debug it better and that it comes out the way I want it to.

What’s happening is that everything works great, but each new entry has the word “content=” next to it.

Does anyone know how to get rid of that?

This the the code I used in the PHP file:


<?
...
//The connection stuff is there already
  $query = "SELECT * FROM news ORDER BY id DESC";
  $result = mysql_query($query);

while ($r = mysql_fetch_row($result))
{
$contents = "<b>". $r[1] . "
" . $r[3] . "</b>
" 
. $r[2] . "
"; // add to the string

print "content=".$contents;  
}
?>

And the following is what I put into one of the keyframes:
[AS]
news.html = true;
loadText = new loadVars();
loadText.load(“news.php”);
//creating the loadVarsText function
loadText.onLoad = function() {
news.htmlText = this.content;
};
[/AS]
The textbox is named news and the variable is content (just in case someone who wants to do something similar to this/has about the same trouble stumbles by :wink: ).

I can’t see any way to get this problem out, and just for visual sake, this is what comes out:

Thanks for any help you guys can provide :slight_smile:
~Kamiko

try


print "content=$contents[content]";

It didn’t work, but I hope you don’t mind explaining why you suggested that because I can’t really see where [content] is coming from.

Thanks :slight_smile:

hmm well i’m pretty new to php, but thats the code I used on my page. however when i load the vars, i use the

loadVariablesNum

My problem stemmed from using loadVariables and it didn’t go away with that loadVariablesNum either :frowning:

Thanks for you efforts though, Digitalosophy :slight_smile:

Btw, in php, when you use the [ ], most of the time it’s for calling a row number (if you use mysql_fetch_row) or the name of the row (if you use mysql_fetch_array). I think the interpreter skipped over the [content] part since it wouldn’t have mattered whether it’s there or not.

I hope that helped clear up some stuff and explains why I’ve asked why [content] is there. :slight_smile:

EDIT:
Turns out all I had to do is make PHP print the content= before the while loop starts! LOL, I got it fixed now. Still, I thank you, Digitalospohy, for responding so quickly and for offering your help. Thanks :beam:

o cool i see. glad you got it working!

and your welcome :slight_smile: