Is it possible to set the value of a number of variables in Flash by using just one call to php and MySQL?
I want to collect 16 or so values from a MySQL database and place them in seperate variables in Flash. Thanks to a couple of tutorials on this site, I’ve managed to do it but I’m looping the same call to a php file lots of times to get each individual value. It seems a clumsy way to do things when one query should be enough.
Can anyone tell me how I might go about getting values for multiple variables with just one call to a php script and one database query?
well, it’s would be a good start if you give some more info wfor us to work with, post your Actionscript that has the loadvars and also the corresponding PHP code.
for as tags, use [ as ]&[ /as ] (without spaces)
for php tags, use [ php ]&[ /php ] (without spaces)
to expand on my problem now that I’ve solved it, the php and MySQL side of things wasn’t an issue, I was just confused how I could return multiple variables when Flash always interpreted whatever the php returned as one long string. Turns out sticking this value in an array in as and using split(","); will do the trick.
Yeah, just build xml with your php query and then import the xml to your flash. Then set your variables to the node values or node attributes. Not that hard and there are a lot of tutorials out there on it;)