How to check for duplicate usernames?
Bob Sneidar
bobs at twft.com
Thu Aug 4 12:13:51 EDT 2011
On save,
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.
Bob
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,
> right?
>
> Here is my code:
>
> --find out if username already exists
> put
> "SELECT UserName FROM UserValidation" into theUN
> put
> 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"
> then
> answer warning "There is an error "&theUNData
> exit to top
> end
> if
>
> Why is it not working? Could anyone with mysql knowledge take a
> shot?
>
> Mike
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list