Eiolon Posted November 19, 2007 Share Posted November 19, 2007 When I created a table I accidentally forgot to make the id a primary key and auto_increment. Can I go back and make it this way or do I need to recreate the table? WANTED reply_id int not null primary key auto_increment ENDED UP WITH reply_id int not null default '0' Thanks! Link to comment https://forums.phpfreaks.com/topic/77988-solved-i-made-a-boo-boo/ Share on other sites More sharing options...
nuxy Posted November 19, 2007 Share Posted November 19, 2007 Use this, just make sure you don't already have a primary key that's set to auto. ALTER TABLE `table` CHANGE `reply_id` `reply_id` INT(10) NOT NULL PRIMARY KEY AUTO_INCREMENT Link to comment https://forums.phpfreaks.com/topic/77988-solved-i-made-a-boo-boo/#findComment-394740 Share on other sites More sharing options...
fenway Posted November 19, 2007 Share Posted November 19, 2007 You can use MODIFY and then you won't have to specify the column name twice. Link to comment https://forums.phpfreaks.com/topic/77988-solved-i-made-a-boo-boo/#findComment-394752 Share on other sites More sharing options...
Eiolon Posted November 20, 2007 Author Share Posted November 20, 2007 Thanks very much Link to comment https://forums.phpfreaks.com/topic/77988-solved-i-made-a-boo-boo/#findComment-395174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.