how to generate id with character in php-mysql
eg:
LAKS01
LAKS02
LAKS03

Recommended Answers

All 6 Replies

IDs are numbers only.
Perhaps you may set a perfix for the ID to get CHAR.ID
But in this case you will set big difficulty for your script to operate with your IDs..
If there are CHARS all math functions will be unusable

IDs are numbers only.
Perhaps you may set a perfix for the ID to get CHAR.ID
But in this case you will set big difficulty for your script to operate with your IDs..
If there are CHARS all math functions will be unusable

but how to create in a simple way

but how to create in a simple way

but cliet need userid with char only

I can't describe you just like this how to create..
give me information what do you need it for, if you have code give it too..
I need at least some idea what do you need.. othere way I may give you bad advice..

Let me be clear:
userID - is NUMBERS only (with it your script can make a lot of checks and functions, that is the idea to be numbers.. if its chars like A,B,C .. you cant Order them, or calculate them, or set which is bigger or less... even if you create a big function which will manipulate this chars, it will use more memory for work.

userNAME is the id written with chars..

So it will be best:
for FUNCTIONS to set USERID (with NUMBERS) type int
for other needs set USERNAME (with CHARs)

Let me be clear:
userID - is NUMBERS only (with it your script can make a lot of checks and functions, that is the idea to be numbers.. if its chars like A,B,C .. you cant Order them, or calculate them, or set which is bigger or less... even if you create a big function which will manipulate this chars, it will use more memory for work.

userNAME is the id written with chars..

So it will be best:
for FUNCTIONS to set USERID (with NUMBERS) type int
for other needs set USERNAME (with CHARs)

thanks for ur reply.
i hav another dbt
how to create parent,child table

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.