Hey Guys,

I've got a question that's gotten me stumped.
Granted, i've been away from MySQL and daniweb for well over 18months, i've picked up pretty much where i left off back then, and am just filling in the blanks as i go along.

My question is:
i have a primary key (auto increment) that i want to set as the following format: 2012xxxxx.

so i have a leading value of 2012, and subsequently 5 trailing values (which are to be auto incremented).

To be honest, im not sure if it can be done or not, but im just hoping (as im going to use the values to produce barcodes for customer files later down the track).

Any help would be appreciated.

Recommended Answers

ALTER TABLE tablename AUTO_INCREMENT = 201200001

Jump to Post

All 2 Replies

ALTER TABLE tablename AUTO_INCREMENT = 201200001

Be a part of the DaniWeb community

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