> how do i check if user exist?
> I tried...
> $result = mysql_query("SELECT count(uname) FROM users WHERE
> uname=\'$username@$domain\'");
Get rid of the \ there. You are inside a ", not a ', and the \ is wrong.
Also, add some error checking like:
if (!$result){
echo "MySQL error ", mysql_error(), "<BR>\n";
}
Actually, don't write it to the screen for users to see on a production box,
but log it somewhere you can get it.
> if(isSet($result))
> return("Username already exists.<br>\n");
> but still wont work.. :(
$result will always be set. You just set it.
You need to do something like:
if (mysql_result($result, 0, 0) == 1){
echo "Username already exists.<BR>\n";
}
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]