$result = mysql_query("select * from uye where kullaniciadi='".mysql_real_escape_string($kullaniciadi)."'"); if(mysql_num_rows($result)>0){ // hata mesajı ver }