hi can any one suggest why this code doesnt work
if(mysql_num_rows(mysql_query("SELECT * FROM users WHERE username = '".$username."'")) == 1)
{
echo "<h1>Error</h1>";
echo "<p>Sorry, that username is taken. Please go back and try again.</p>";
}
else
{
$registerquery = mysql_query("INSERT INTO users (fname,lname,age,email,phone,address,username,password,
amount,plan,benefit,prem1,prem2) VALUES
('".$fname."', '".$lname."', '".$age."', '".$email."', '".$phone."', '".$address."', '".$username."', '".$password."', '".
$amount."', '".$plan."', '".$benefit."', '".$prem1."', '".$prem2."')");
if($registerquery)
{
echo "<h3>Success</h3>";
echo "<p>Your account was successfully created. Please <a href=\"index.html\">click here to login</a>.</p>";
}
else
{
echo "<h3>Error</h3>";
echo "<p>Sorry, your registration failed. Please go back and try again.</p>";
}