Jump to content

creating a unique number


moosey_man1988

Recommended Posts

Hi There

 

I'm fairly new to PHP and I'm currently working on a small website for testing purposes.

 

I am working on a customer form

 

I was previously using the auto_increment function in mysql to in order to generate a customer ID but I want a prefix on the beginning and you cant use VARCHAR with auto increment.

 

I want to be able to create a unique ID incrementing by 1 with a prefix e.g.

 

fill in the form and this generates a customer number of CN00001 then the next time you do it it will make CN00002,

 

how is this possible, if you can point me in the right direction I would be very grateful.

 

Many Thanks

Mooseh

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.