If you want to check for an existing username could you use a query like SELECT username FROM table WHERE username= \"$username_to_test\" and then use the following code to determine if the particular username exists or not: $row = mysql_fetch_array($result); if(!($row)) echo $usernameexists; Or is there a better way?
I typically use something along the lines of: <?php if (mysql_num_rows($result) == 0) { echo "Username exists!"; exit(); } ?> PHP: Obviously thats a very stripped down version, but you get the idea.