User Name Suggestion

Results 1 to 2 of 2

Thread: User Name Suggestion

  1. #1
    Join Date
    Dec 1969

    Default User Name Suggestion

    Hey Guys, how do I display alternative user names that I user can use, in the case where their desired user name is already taken.<BR><BR>For example if a user wants myname as a userid but it&#039s taken already.. I want my to give them alternatives that have not been taken like<BR><BR>myname2<BR>myname44<BR><BR>or whatever.<BR><BR>Thanks in advance <BR>

  2. #2
    Josh Rolfe Guest

    Default RE: User Name Suggestion

    First of all you need to decide on what convention you are going to use for your alternatives. If you are going to use incremental numbers after the username, as in your above example, then there are a few ways to do it. One way is to set up a loop that increments numbers from 1 to 10 or (or whatever). Then concatenate the username with the number (myname1) and check it against the database of existing names. The sql would be something like <BR><BR>SELECT UserName FROM UserNameTable WHERE UserName=&#039" & UserNameRequested & counter & "&#039" <BR><BR>If no match (your recordset is at EOF), suggest it for the user. To suggest multiple names, consider writing them to an array so you can loop through the array later to display all the suggestions. You may want to set up another counter to track how many suggestions do not have matches in the database, then exit the loop when you have the desired number.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts