RE: [PHP-DB] make a filled column auto_increment

From: Date: Mon, 08 Oct 2001 16:05:52 +0000
Subject: RE: [PHP-DB] make a filled column auto_increment
Groups: php.db 
Request: Send a blank email to php-db+get-13116@lists.php.net to get a copy of this message
delete the column and re-create it; this is the fastest, surest method -----Original Message----- From: Bas Jobsen [mailto:bas@startpunt.cc] Sent: Saturday, October 06, 2001 5:37 AM To: php-db@lists.php.net Subject: [PHP-DB] make a filled column auto_increment Hello, How can i make a column auto_increment? my table (table1): id|others 0|x 1|x 2|x etc ALTER TABLE table1 ADD PRIMARY KEY (id); #oke ALTER TABLE table1 ADD UNIQUE id (id); #oke ALTER TABLE table1 CHANGE id id BIGINT UNSIGNED not null AUTO_INCREMENT; OOPS: Duplicate entry '1' for key 1 Best regards, Bas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#13116) next »