how to auto_increment a char datatype in table create command

When I tried it in PHPmyadmin I got:

CREATE TABLE `test` (
`id` CHAR( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` INT NOT NULL
) ENGINE = MYISAM

MySQL said:
#1063 - Incorrect column specifier for column 'id'

So I fear that what you are trying to do is impossible. The idea behind auto_increment is that you add 1 for each new record so that every record has a differing ID (I believe it is, at least). Why would you want your ID to be a char? What would ID's like (A, B, C, D, E) differ from (1, 2, 3, 4, 5)?

Unless offcourse your trying to do something different with your auto_increment. You could always do the incrementing in PHP itself.

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.