Use an auto_increment field.

ie.

create table foo (
    id      mediumint unsigned not null auto_increment primary key,
    name    char (16) not null,
    ...
)

--zak


----- Original Message ----- 
From: "Reuben D Budiardja" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 10, 2001 9:41 PM
Subject: [PHP] Mysql sequence help (OOT)



Hello,
Sorry for a litle bit out of topic. 
But can anyone tell me how to create sequence in mysql?

For example, if I have table with column ID, NAME. I want ID to be 
incremented by one (say starting from 100) everytime I insert a new row 
to the table. How can I do that in mysql?

I'm only use to Oracle, and tried to find it in mysql.com, but has not 
yet succed. And I'm a bit under time pressure.

Thanks for any help in advance.
Reuben D. Budiardja

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to