Hi,

There is no AUTO_INCREMENT() function.  AUTO_INCREMENT is a
directive that you specify when you create a table.

Try this:

CREATE TABLE test
(
  Id int unsigned not null auto_increment,
  primary key (id)
);

INSERT INTO test VALUES (NULL), (NULL), (NULL), (NULL), (NULL);

SELECT * FROM test;

auto_increment column must be keyed and only one auto_increment col
is allowed per table.

Regards,

Jindo

> -----Original Message-----
> From: Kevin Haughton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 17, 2001 3:01 AM
> To: [EMAIL PROTECTED]
> Subject: newbie question AUTO_INCREMENT
> 
> 
> Hi all,
> after reading the MySQL manual I see there is a AUTO_INCREMENT function.
> Tried all the examples but couldn't get it to work (man I must be too thick
> for this game ;))
> 
> How would I go about setting my column "id" to auto increment? I read as
> much as I could take for 2 days and I'm no clearer on the subject.
> 
> many thanks ;)
> 
> Karv


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to