How to check for duplicate usernames?

Admin admin at
Thu Aug 4 11:42:53 EDT 2011


I have a reasonably well working database now, however, you can
still duplicate usernames - my code is not working. I can gain access to
he database, no problem. 

I can write to and read from with no problem

Here, I just want to access the UserValidation table, grab all the
usernames and compare the current one in the password field to all the
ones in the database. If 

there's a match, then I want to tell them to
choose another username since it is taken. Pretty straight forward,

Here is my code: 

--find out if username already exists
"SELECT UserName FROM UserValidation" into theUN
revDataFromQuery(,,dbID,theUN) into theUNData

 if theUNData = the text
of field "fldUserName" then
 answer "Username already exists, please
pick another"
 exit to top
 end if

 if theUNData contains "revdberr"
 answer warning "There is an error "&theUNData
 exit to top

Why is it not working? Could anyone with mysql knowledge take a



More information about the Use-livecode mailing list