mySQL query with php in flash dynamic text field

Hello! I have made flash web site with registration form. Now i’m trying to make some kind of module for it. I have one dynamic text field in which i want to load the info for the current user. So i made the dynamic text field in movie clip and put this as to it:
Code:
onClipEvent (load) {
loadVariables(“fetch.php”, this, “GET”);
}
I also gave the text field variable name “content”. Then i have one more dynamic text field which is in another movie clip. This text field has variable “curUser” and it loads the username when some one logs in. It takes the text when the user types it in the input text field. This is for the flash part. Then the php file - Code:
<?php
$dbhost=‘localhost’;
$dbusername=‘root’;
$dbuserpass=‘root’;
$dbname=‘moon’;

mysql_connect("$dbhost", “$dbusername”, “$dbuserpass”)or die(“cannot connect to server”);
mysql_select_db("$dbname")or die (“no database”);

$tbl_name=member;

$sql=“SELECT username FROM $tbl_name WHERE $name=“username””;
if ($name=$_POST[‘curUser’]:wink: {
$result =mysql_query($sql);
$count=mysql_num_rows($result);
$rows=mysql_fetch_array($result);

print $name;
print “content=$name”;

}
else {
$no_result=“registrirai se be!”;
print (“content=$no_result”);
echo “content=$no_result”;
}

?>
We first connect to the mySQL server, then we make query for the value we are after - in our case ‘username’. Then we check if the user name in the table is the same as the curUser. If it is suppose to print the user name in the dynamic text field, but it doesn’t. Can anyone help me?!