RIRedinPA Posted December 18, 2008 Share Posted December 18, 2008 I'm trying to drop my id column and then add it back to the db. This seemed to work but it generated an error (but the column was deleted) ALTER TABLE AddressBook DROP COLUMN id but then I wasn't able to add the id column back. I'm also not sure how to declare this as a primary key... ALTER TABLE AddressBook ADD Column (id bigint not null auto_increment) thanks Quote Link to comment https://forums.phpfreaks.com/topic/137571-solved-droping-and-altering-id-column/ Share on other sites More sharing options...
RIRedinPA Posted December 18, 2008 Author Share Posted December 18, 2008 This query did not work. ALTER TABLE AddressBook ADD COLUMN "test" AFTER "email" Quote Link to comment https://forums.phpfreaks.com/topic/137571-solved-droping-and-altering-id-column/#findComment-719098 Share on other sites More sharing options...
rhodesa Posted December 18, 2008 Share Posted December 18, 2008 ALTER TABLE AddressBook ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST Quote Link to comment https://forums.phpfreaks.com/topic/137571-solved-droping-and-altering-id-column/#findComment-719105 Share on other sites More sharing options...
RIRedinPA Posted December 18, 2008 Author Share Posted December 18, 2008 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/137571-solved-droping-and-altering-id-column/#findComment-719114 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.