RE: [PHP] check if user exists

From: Date: Wed, 01 Aug 2001 18:51:14 +0000
Subject: RE: [PHP] check if user exists
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60740@lists.php.net to get a copy of this message
> how do i check if user exist? > I tried... > $result = mysql_query("SELECT count(uname) FROM users WHERE > uname=\'$username@$domain\'"); > if(isSet($result)) > return("Username already exists.<br>\n"); > but still wont work.. :( if (mysql_num_rows(mysql_query("SELECT uname FROM users WHERE uname = '$username@$domain'")) > 0) { return("Username already exists.<BR>\n"; } That should work for you. Sincerely, Craig Vincent

« previous php.general (#60740) next »