Jump to content

Installing an auto-increment field in an existing table in phpMyAdmin


iainlang

Recommended Posts

I've searched the Knowledge Base but couldn't find anything which answered my question.

 

I have an auto-increment id field in my tables which (for reasons of displaying the unsigned zerofill in limited screen space) I want to replace with a new auto-increment id field which will, of course, start again at 0.

 

In phpMyAdmin, I delete the existing auto-increment id field and, when trying to install a new one, I get -

 

"ALTER TABLE `help` ADD `id` SMALLINT( 2 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT FIRST

 

MySQL said: 

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key  "

 

I expect it's something terribly simple and I'm just being stupid.

 

Can anyone help, please?

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.