$sql=mysql_query("SELECT FROM users (username, password, email) WHERE username=$fusername");
if(mysql_num_rows($sql)>=1)
{
echo"name already exists";
}
else
{
//insert query goes here
}
u kunt vanuit de database controleren of de gebruiker bestaat en vervolgens de code plakken