$result = mysql_query("SELECT * FROM user WHERE username = '$user'"); if (mysql_num_rows($result) > 0) { echo "الاسم محجوز ، يرجى تغييره"; exit; }