Easy :-)
Step 1 - Connect to db
Step 2 - Select username or whatever from table
Step 3 - Set variable for this username
Step 4 - Check if variable is the same as the name they entered
Step 5 - Give error or add to db.
<?php
//connect to db
$db = mysql_pconnect("localhost", "dbusername", "password");
mysql_select_db("dbname",$db);
//get username from table
$checkuser=mysql_query("SELECT username FROM tablename",$db);
while($detail=mysql_fetch_array($checkuser)) {
$userfromtable = $detail["username"];
//if username is the same, error
if ($userfromtable == $username) {echo "Sorry, that username is taken, please choose another"; exit; }
//is username is different, insert
elseif ($userfromtable != $username) {INSERT into ... }
//this ends the while loop
}
?>
It may be a little confusing cause I user username, user, and things so much, if you need clarification or anything yell.
I'm also assuming your fine with the form stuff.