Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I need help about user id. I want generate ID with 3 or 4 Alphabet in user ID
PHP
Exp: LD0001
and the user id is increment. Any idea how to make it?

What I have tried:

I found this in google
MySQL
PHP
CONCAT


But still don't how to use it in PHP
Posted
Updated 25-Dec-16 22:43pm

 
Share this answer
 
Comments
JaironLanda 26-Dec-16 1:05am    
example how to use it? still not understand.. .____.
Hi,

check this...

if your aplha part is fixed, then no need of storing it simply make use of query.
SQL
Select 'LD'+right('00000'+cast(userid as varchar),5) AS aplhnumeric_Id


Hope this will help you.

Cheers
 
Share this answer
 
Comments
JaironLanda 27-Dec-16 0:20am    
if my aplha is not fixed? any idea?
Magic Wonder 27-Dec-16 0:43am    
What exactly are you looking for?
JaironLanda 27-Dec-16 0:50am    
example. my age is 21 then i get member ID like this AG001 else AGS001
Magic Wonder 27-Dec-16 0:54am    
Okay, so you must be having some thought for getting "AG" or "AGS". Kindly share.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900