usernames validation,
Posted by: andrewkinyua86 (---.lmdaca.adelphia.net)
Date: April 03, 2006 01:35AM

How do i check and make sure that the username that the user chooses is not taken by another person in the database? any help I would appreciate.



Andrew

Re: usernames validation,
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 03, 2006 09:47AM

This statement will return true if the username is taken, false if it is available. Keep the @ infront of the mysql_query statemnt, this keeps the statement from displaying an error the statement will return if if can not find a matching username

if (!@mysql_query (SELECT username FROM somedatabase WHERE username='$checkusername') {
return false;
} else {
return true;
}

Sorry, only registered users may post in this forum.