hello,

our site have 1000 users.here i have to give unique numbers from '000' to '999' to each user.
now i am adding from starting '000'. how can i give unique numbers to users when adding and updating users?

Thanks

Recommended Answers

All 2 Replies

Member Avatar for diafol

I agree, storing 000 as a PK doesn't really make sense as a rule. You can use str_pad() to give leading zeroes if you really have to. I'd advise NOT using these leading zeroes in any part of your DB tables. It should be just a cosmetic thing for screen output. Or do you have a different use in mind?

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.