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 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" 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 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! 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
Archived
This topic is now archived and is closed to further replies.