futrose Posted February 11, 2011 Share Posted February 11, 2011 I have already created my table and I forgot to add AUTO_INCREMENT to my ID row. I can't seem to find the SQL command to put it in. I think it is something like alter table elders modify extra auto_increment... I'm not sure how to specify that it should only add it to the ID row and not all of them. By the way I'm using the command line, I don't have phpmysqladmin installed at the moment. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/227354-add-auto_increment-to-a-row-when-table-is-already-created/ Share on other sites More sharing options...
bh Posted February 11, 2011 Share Posted February 11, 2011 You have to modify the column: ALTER TABLE table_name MODIFY COLUMN column_name INT AUTO_INCREMENT; Quote Link to comment https://forums.phpfreaks.com/topic/227354-add-auto_increment-to-a-row-when-table-is-already-created/#findComment-1172687 Share on other sites More sharing options...
futrose Posted February 11, 2011 Author Share Posted February 11, 2011 worked beautifully... Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/227354-add-auto_increment-to-a-row-when-table-is-already-created/#findComment-1172688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.