MySQL Forums
Forum List  »  PHP

create username from first initial and last name
Posted by: Joshua Wahila
Date: December 26, 2005 05:54PM

I'm trying to set up a database so that a user can enter their first name, and last names, and then have it automatically assemble their username into (first initial)+(last name)+(number)

I found this string "INSERT(str,pos,len,newstr)"... and thought it might work like for what i'm trying to do

INSERT(Firstname, 2, 40, Lastname)?

I used this code to setup my database:
http://www.free2code.net/plugins/articles/read.php?id=99

so I would want to incorporate this feature into the "register" section, where it automatically assembles the username from the information the user submits, checks for duplicate entries, and if found, adds a number after it which automatically increases...

so like there would be
jsmith
jsmith2
jsmith3

someone please help?

Options: ReplyQuote


Subject
Written By
Posted
create username from first initial and last name
December 26, 2005 05:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.