RE: [PHP-DB] make a filled column auto_increment
| From: | Troy Settle | Date: | Sun, 07 Oct 2001 07:03:30 +0000 |
| Subject: | RE: [PHP-DB] make a filled column auto_increment | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13078@lists.php.net to get a copy of this message | ||
Hmm... you don't say which SQL server you're using, but it looks like it
might be MySQL. I've not played with it for a while, but if I remember
correctly, there's an IGNORE clause that you can pass into the ALTER TABLE
statement that will cause it to ignore that error.
HTH,
--
Troy Settle
Pulaski Networks
540.994.4254 - 866.477.5638
http://www.psknet.com
** -----Original Message-----
** From: Bas Jobsen [mailto:bas@startpunt.cc]
** Sent: Saturday, October 06, 2001 6: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
**
**