iainlang Posted May 31, 2008 Share Posted May 31, 2008 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? Link to comment https://forums.phpfreaks.com/topic/108159-installing-an-auto-increment-field-in-an-existing-table-in-phpmyadmin/ Share on other sites More sharing options...
BlueSkyIS Posted May 31, 2008 Share Posted May 31, 2008 needs to be PRIMARY KEY, too. when adding the field, check the key checkbox. Link to comment https://forums.phpfreaks.com/topic/108159-installing-an-auto-increment-field-in-an-existing-table-in-phpmyadmin/#findComment-554444 Share on other sites More sharing options...
iainlang Posted May 31, 2008 Author Share Posted May 31, 2008 Thank you for your swift response. I do check the PRIMARY BOX radio button, always did, but still get the same error message. Link to comment https://forums.phpfreaks.com/topic/108159-installing-an-auto-increment-field-in-an-existing-table-in-phpmyadmin/#findComment-554452 Share on other sites More sharing options...
iainlang Posted June 1, 2008 Author Share Posted June 1, 2008 Friendly bump. Link to comment https://forums.phpfreaks.com/topic/108159-installing-an-auto-increment-field-in-an-existing-table-in-phpmyadmin/#findComment-554659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.