It looks like you're new here. If you want to get involved, click one of these buttons!
//Check if username already exists...
$q2 = mysql_query("SELECT * FROM `users` WHERE `username` = '".$_POST['username']."'");
$q3 = mysql_fetch_object($q2);
if($q3->username == $_POST['username']) {
die('<BR><BR>Sorry, but the username "'.$q3->username.'" is taken, please choose another.');
}
Comments
[PHP]
$username = $_POST;
$q = "SELECT username FROM users";
$q2 = mysql_query($q);
if($q2 == $username){
print 'Sorry the username ' . $username . ' has already been taken.';
}
[/PHP]
it should work...