How to check for duplicate usernames?
bobs at twft.com
Thu Aug 4 12:13:51 EDT 2011
select username from uservalidation where username = <the value of the new username>
count how many records got returned. If greater than 0 you have a duplicate.
On Aug 4, 2011, at 8:42 AM, Admin wrote:
> 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
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode