Jump to content

Archived

This topic is now archived and is closed to further replies.

Natedawg

I need a query, can't find it anywhere.

Recommended Posts

I need a query for adding a column to my table, an auto increment one, so I can keep track of how many items I have in my database. I think it\'s like, ADD COLUMN TO Message idno int AUTO_INCREMENT is that it?

Share this post


Link to post
Share on other sites

The syntax is

 

ALTER TABLE table_name

ADD COLUMN column_name INT UNSIGNED NOT NULL AUTO_INCREMENT,

ADD INDEX (column_name);

 

You\'ll find an example in the MySQL manual, section 6.5.4 under ALTER TABLE.

 

Joe

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.