$sql = "SELECT * FROM users WHERE username='" . $_POST["username"] . "'";
if(!($result = mysql_query($sql))) {
die(mysql_error());
}
if(mysql_num_rows($result) > 0) {
echo "<font color=\"#FF0000\"><b>The Username you specified has already been taken.</b></font><br />";
exit();
}
hi
I can not see anything wrong with your code.
Does this happen every time, only some time and has this been for long?
Logically you should check your query:
tablename
fieldname
values used in query
A good way to avoid this issue completely, is to
CREATE TABLE
with field 'username' set to be UNIQUE KEY
This will make it impossible to add a username,
that is NOT UNIQUE to the already existing.