U
unknownsk8r
Guest
Hey all. I have a little problem. I am making a user system, and i'm almost DONE!! But one problem. The registration page doesn't work. The problem is, im trying to check if the username + email are taken, but when I create a account in the DB itself, and then try to create one through the script, it creates the account even if the names are the same. Here is my code:
// Checks to see if username/email is taken, if not then creates the account
if (mysql_query("SELECT * FROM `user` WHERE `username`='$username' OR `email`='$email' LIMIT=1")===true)
{
echo ("Username/Password taken!");
}
else
{
mysql_query("INSERT INTO `user` (username, password, email, ip)
VALUES ('$username', '$password', '$email', '$ip')");
}
// Checks to see if username/email is taken, if not then creates the account
if (mysql_query("SELECT * FROM `user` WHERE `username`='$username' OR `email`='$email' LIMIT=1")===true)
{
echo ("Username/Password taken!");
}
else
{
mysql_query("INSERT INTO `user` (username, password, email, ip)
VALUES ('$username', '$password', '$email', '$ip')");
}