I added this to check if username exists when adding administrator on my site:
Okay so I added that to the 'edit admin' function and I get the message 'The username you have chosen already exists.'. I think I know why, but I can;t fix it.
Any help will be appreciated.
-CALV1N
Code:
$result = mysql_query("SELECT username from admin where username='$username'");
list($usernametocheck) = mysql_fetch_row($result);
if (!$usernametocheck) {
//good!
} else {
Message("Username Exists", "The username you have chosen already exists.", "");
}
Okay so I added that to the 'edit admin' function and I get the message 'The username you have chosen already exists.'. I think I know why, but I can;t fix it.
Any help will be appreciated.
-CALV1N