I'm having some troubles when editing an admin on my script.
For example when the username stays the same, I get the 'username exists' message.
Incidently, this code snippet is the exact one I use on the 'add admin' function on my script, so I know why it isn't working, just can't find a way to solve it. :-(
Thanks.
-CALV1N
For example when the username stays the same, I get the 'username exists' message.
Code:
is_admin();
require '../lib/config.php';
connectcp();
$result = mysql_query("SELECT username from admin where username='$username'");
list($usernametocheck) = mysql_fetch_row($result);
if (!$usernametocheck) {
//good!
} else {
CPMessage("Username Exists", "The username you have chosen already exists.", "");
}
Incidently, this code snippet is the exact one I use on the 'add admin' function on my script, so I know why it isn't working, just can't find a way to solve it. :-(
Thanks.
-CALV1N