Hi Guys,
Can anyone tell me how to send a variable to a Flash text input field from a php script. The script below at this stage checks the username ($nickname) against a MySQL database, this works fine but i need to send the $result if it does not = 0 to the flash text input field inorder to tell the user that the name has been taken.
Any help greatly appreciated.
<?
$Connect = mysql_connect('localhost', 'username', 'password');
@mysql_select_db("login");
#Preforms the SQL query
// get a date stamp
$date = date("Y-m-d");
$result = mysql_query("SELECT * FROM names where login_name=$nickname;");
if( mysql_num_rows($result)!= 0)
{
//inform user that a match has been found
echo "User name is already registerd";
}
else
{
//build query to insert the new user
$query = "INSERT INTO names (login_name,add_date) VALUES(\"$nickname\", \"$date\")";
$result_a = mysql_query($query);
}
?>
Cheers,
Michael