I am trying to get data from a MySQL database into Flash. In flash, I have
[AS]
loadVariables(“news.php”,“content”);
[/AS]
on the first frame of the main movie where content is the movieclip the variables should be loaded into. Inside content, I have a dynamic text field with the var ‘inhoud’. On the left of that dynamic textfield, there is an empty movieclip called ‘img’, in which an image should load. So on that movieclip I have
Now when I tested the movie, it didn’t work. So I viewed the php file, and this HUGE list comes up, which just grows longer and longer. It almost overloads my computer. What do I have to do to prevent this ?
because you are telling the loop to print out the string output every time the loop executes and the loop gets bigger and bigger with each loop. thats why it prints out so much info.
Well basically … only the text That would be ‘datum’ and ‘inhoud’. The image that should be loaded is “home”+i+".jpg", where i = $nrows. So that basically means that if I create another row (with other content), it goes to home2.jpg, and so on.
Now that I think about it, the ‘<**br><**br>’ I have there is totally useless, as the PHP is only defining vars for Flash, and not filling in the vars in Flash … and the ‘img’ column is useless too …
not necessarily. I think its just because he is storing all the data inside that string and then telling the loop to print out that string with each loop. You don’t realyl want that. You want to add all the data to the loop and then once the loop is finished print out the data.
No it still doesn’t work. The PHP file now generates the whole loop, and is then supposed to write that whole bunch, but I didn’t wait for that :P. Can I fix the loop somehow ?
*Originally posted by Jubba *
**not necessarily. I think its just because he is storing all the data inside that string and then telling the loop to print out that string with each loop. You don’t realyl want that. You want to add all the data to the loop and then once the loop is finished print out the data. **
you have to wait for the loop to finish executing and then print out the data as one long string so Flash can read it. Use the code that I gave you in one of my previous posts.
and the link is http://voetsjoeba.xszone.nl/test/news.php. Right now it does nothing, cuz it’s still in that loop, and keeps generating data and thus doesn’t print anything (I guess, cuz I ain’t waiting for it )