When you input data you don;t want to have the same name or id of a row (if you didn't do it purposely)
TO check if there already one email or name you need to select first
$result = db_query("SELECT id FROM users WHERE email='" . mysql_real_escape_string($email) . "'");
if (mysql_num_rows($result) > 0)
$error_string .= 'That email address is already registerd.<br>';
What i did is select id id is one of the most best way to organize your user each user have it id which is like id 1 2 3.... and it count up when a new user register... so in this here select id from users table and where email is the same as the one trying to register ( i repeat it can select -- the email from database-- is the same as -- the one user put in -- in REGISTER html form..) hope you get it.. and so if php can select that mean it already register .
and if select more then 0 that what >0 mean more then 0 ( there won't be more then one if everytime someone register have check to see if email already register **but sometime admin will create different accout for the same email <i don't know but more then 0 will be work for MOST of the people...>
I hope you read what i said

because if you really want to learn PHP this stuff are important these are what i learn from experience so it is a short cut for you...
_________________