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
https://forums.phpfreaks.com/topic/296292-creating-a-unique-number/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.