hello friend i just wanna learn if a way exist to generate AUTO_INCREMENT i have my datble and the colum ID is an AUTO_INCREMENT and the id is from 1, 2, 3 .... i would like to diferent id for exemple : CC13445356 i want 2 letter at begin or 3 and 6 number and i dont want write it every time i want a AUTO_INCREMENT do that for me i use phpmyadmin
Jump to Post
An auto increment column MUST be integer, so you cannot use
cc123, but you can create composite indexes, so you can create unique content, for example:
create table mytest( id int unsigned auto_increment, code varchar(3) not null, message text, primary key (code, id) ) engine = …
All 2 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.