If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How do I set up Autonum?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-04, 09:59
Nixies Nixies is offline
Registered User
 
Join Date: Jul 2003
Posts: 100
Question How do I set up Autonum?

Persently I am trying to create a table with a field in it that automatically increment, A autoNum field.

Is this possible in MySql if so could someone point me in the correct drection,

Thanks Nixies
Reply With Quote
  #2 (permalink)  
Old 04-30-04, 14:05
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
use auto_increment.

If you want to use a higher value than 1 for your auto_increment value then either set up the table with it or use alter table to change it.

It needs to be a myisam table and not innodb table though.

Code:
create table testing(
id int primary key auto_increment,
firstname char(12),
lastname char(12)
) type=myisam
auto_increment = 34533
;
and that value is the first one that will start in your id table.

Last edited by guelphdad; 04-30-04 at 14:17.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On