I created a registration form but at the moment it submits ANYTHING that it gets that passes the validation... what I want is for it to check the database for already existing name and email and if the user submitted info with the same Name and/or Email than the user would get an error.
Please I need some help with this... I can't make the darn mysql select statement to work and that is really frustrating...
For displaying the values... I can't get the following to work
Code: Select all
$result = mysql_fetch_array(mysql_query("SELECT Name FROM `user` WHERE Email='some@email.com'"));
echo $result;And for checking... I can't get the following to work
Code: Select all
$query="SELECT Name,Email FROM `user` WHERE Name='$name', Email='$email'";
if(mysql_fetch_array(mysql_query($query)))
{
echo "The following values are already on the database:";
echo $name;
echo '<br />';
echo $email;
echo '<br />';
echo 'So, either you already have an account or you have someone by your name signed up for membership.<br />';
echo 'If this is you than please click on "Forgot Password" link at sign-up. <br />';
}