MYSQL ---> PHP ---> AS3 (Need help with little code)

Hi everyone,

For those of you who are familiar with sending information from MYSQL to PHP and then to AS3, I need some help. Basically I have a MYSQL Table with [COLOR=“YellowGreen”]3 names[/COLOR] in it, all on the first row. All I want to do is have PHP grab what is on the first row (which I can do), and then have AS3 grab that same info from PHP. I can currently do this, however rather than AS3 displaying the [COLOR=“YellowGreen”]3 names[/COLOR], it comes back with the row label as well, called “firstname”. So it comes back with “firstname=Mikefirstname=Jamesfirstname=Rob” I simply want it to come back with MikeJamesRob. Confused yet? :hr:

Here is the PHP code. The loop retrieves the [COLOR=“YellowGreen”]3 names[/COLOR] from the MYSQL Database, and I make the variable $returnVars EQUAL what it comes back with, so that I can send it back to AS3.


// Make a MySQL Connection
include_once "connect_to_mysql.php";
// Get all the data from the "members" table
$result = mysql_query("SELECT * FROM members") 
or die(mysql_error());  
// Make a while loop to fetch all of the data from the table
while($row = mysql_fetch_array( $result )) {
// Make the returnVars string for AS3(flash)
$returnVars['firstname'] = $row['firstname'];
$returnString = http_build_query($returnVars);
// Display the information for AS3 to retrieve
echo $returnString;

For the AS3 code I am leaving out the methods to retrieve the data. It works. I am just showing you how I am calling the variable through “firstname”.

var username =;
textBox.text = username;

After all of this, textBox.text displays this: